问题
解决方法:兄弟组件传值,重新改变tab值
新建bus.js文件
import Vue
from "vue";
export default new Vue();
foot组件,点击事件
import Bus
from '../../common/js/bus.js'
goagreement(i
) {
if (this.$route
.path
.includes("agreement")) {
Bus
.$emit("type", i
);
} else {
this.$router
.push({
path
: "/agreement",
query
: {
type
: i
}
});
}
}
agreement页面接受type值
import Bus
from '../../common/js/bus.js'
created() {
Bus
.$on("type", (val
) => {
this.type
= val
})
},
转载请注明原文地址:https://blackberry.8miu.com/read-33552.html