vue中路由传参问题
1.在index.vue中引入路由.注册需要使用的组件并且引入。
< router-view > < /router-view >
在使用的地点使用router-viewy引入路由
import Group from “./group/Group.vue”;
//人员分组
export default {加粗样式
components: {
Group
},
methods: {}
};
2.在Group.vue这一个组件中传参:
a.在组件中引入需要跳转的组件
import AppManage from ‘./appfile/AppManage’
export default {
name: “Group”,
comments:{Personnel,AppManage,PcManage,Resources},
}
b,点击按钮button时调用方法
button(){
this.$router.push({
path: “appmanage”,
query:{
appchildrout: ‘appblack’
}
})
}
c,在AppManage组件中就可以引用了传过来的参数:
export default {
data() {
return {
showup: this.$route.query.appchildrout,
}
},
注:有不妥的地方望给为大神赐教:在此谢过了。