在User.vue写上:
<template>
<div>
<router-link :to="{name: 'add'}">添加</router-link>
</div>
</template>
在router.js添加一条路由:
{
path: '/add',
name: 'add',
component: () => import('./views/Add.vue')
}
<template>
<div>
<router-link :to="{name: 'add'}">添加</router-link>
</div>
</template>
在router.js添加一条路由:
{
path: '/add',
name: 'add',
component: () => import('./views/Add.vue')
}
2019-03-29