首页 > 其他 > 详细

「Vue」程序式路由导航用法

时间:2019-03-09 10:42:03      阅读:179      评论:0      收藏:0      [点我收藏+]

1、button发起点击请求
<mt-button type=‘primary‘ size=‘large‘ plain @click="topdcmt(id)">商品评论</mt-button>
2、methods定义方法
topdcmt(id){this.$router.push({ name: ‘pdcmt‘, params: { userId: id } })}
3、router.js定义导航路径
import Pdcmt from ‘./components/product/productcomment.vue‘
{path: ‘/home/productcomment/:id‘,component: Pdcmt,name:‘pdcmt‘},

「Vue」程序式路由导航用法

原文:https://www.cnblogs.com/wrxblog/p/10499712.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!