页面上的一个链接
<router-link :to="{ name:'infoedit',params:{'id':'12'} }">修改</router-link>
点开后需要打开编辑修改页
路由设置:
{
path: '/infoedit/:id',
name: 'infoedit',
component: () => import('../views/my/infoedit.vue'),
meta: {
title: '修改内容'
}
},
infoedit.vue
created() {
const that = this;
let params = {};
const id = that.$route.params.id;
params = {
第一次从修改链接打开这个编辑页面的时候,正常获取到id。但是在这个页面点刷新之后,就无法获取到id
发现开启:history 后失效,不开启history模式的时候有效
求帮助