我点击第一个查看按钮跳转
这里显示1 西游记 吴承恩 100 请问如何实现
现在页面显示的数据已经是后台数据库的数据了
this.$router.push({
name: 'describe',
params: {
id: id
}
})
this.$route.params.id
//跳转页面
this.$router.push({
path: '/describe',
query: {
id: id
}
})
//页面内取路由参数
this.$route.query.id
<router-link :to="{path: '/describe', query: { year:this.year_select,month:this.month_select,admin_user_id:key }}">
查看
</router-link>
吧当前列表的某一列,也就是row 放在参数中 比如...earch?likeParam=account_name%3D%2715016858075%27&globalTime=%7B%22timeFlag%22%3A3,%22startTime%22%3A1549856574598,%22endTime%22%3A1549942974598,%22timeInterval%22%3A7,%22timeUnit%22%3A%22d%22%7D&_r=1549942979139
这是在不同页面还是同一页面的不同组件的数据传输?
如果是页面之间的跳转,参数放在url 的search 上即可, 如 url?no=bookNo&name=bookName..
2. 如果是同一个页面之间的不同组件的数据传输,通过 props 输入数据即可。
其实你可以把查看弄成一个弹窗组件,这样操作起来也方便,然后你需要传值直接通过组件的props传递会方便很多