一、父页面
1、在你的父页面上,provide提供参数
// 提供
provide() {
return {
urls: this.urls
}
},
2、向子页面提供的函数:
二、子页面1,点击跳转按钮的页面:
2、在子页面跳转按钮的时候加入到提供的参数那里:
第一步注入父类提供的函数:
// 注入
inject: ["urls"],
第二步:将你需要传递的参数进行传递:
三、二点击按钮跳转到的页面:
1、注入父类提供的函数:
2、为避免页面还没打开过的,所以在加载完成后调用
mounted() {
const credid = this.$route.query.data.credid;
if(null != credid && undefined != credid){
const data = {"id":credid};
this.update2(data);
}
},
3、如果已经打开了的,则是通过监听来处理:
v是二按钮页面传递过来的数据