我试图传递我的路由器链接名称的道具,但它根本不起作用。我究竟做错了什么?
按钮组件:
<template>
<router-link :to="{ name: nextStep }" tag="button" class="button">Back</router-link>
<router-link :to="{ name: previousStep }" tag="button" class="button">Next</router-link>
</template>
<script>
export default {
props: {
nextStep: {
type: String,
default: null,
},
previousStep: {
type: String,
default: null
}
},
}
</script>
当我使用该组件时
<Buttons :nextStep="Firststep" :previousStep="Secondstep" />
我的路由器 js 确保名称正确
{
path: "/firststep",
name: "Firststep",
component: FirstStep
},
{
path: "/secondstep",
name: "Secondstep",
component: SecondStep
},
茅侃侃
相关分类