当前位置: 首页 > Web前端 > vue.js

Vue刷新组件提供reload

时间:2023-03-31 23:40:17 vue.js

1.Vue局部刷新组件1.在app.vue中这样定义2.在子组件中引入,调用inject:['reload'],asyncagentCommit(){if(this.$refs.tree.getCurrentNode()){awaitthis.$store.dispatch("agentChange",this.$refs.tree.getCurrentNode());这个.reload();//调用接口回调后刷新}},二:window.location.reload()浏览器全局刷新,关卡页面重新加载总结:推荐使用第一种方案,不会清除控制台中的网络请求信息,第二个遗嘱