vue项目实现重新加载本页面
作者:互联网
App.vue:
<tempalte> <router-view v-if="isRouterAlive" /> </tempalte> export default defineComponent({ provide () { return { reload: this.reload } } data () { retrun { isRouterAlive: true } }, methods: { reload () { this.isRouterAlive = false this.$nextTick(() => { this.isRouterAlive = true }) } } })
页面使用:
<el-button @click="reload">刷新页面</el-button> export default { inject: ['reload'] }
标签:vue,isRouterAlive,reload,export,加载,true,页面 来源: https://www.cnblogs.com/150536FBB/p/16504826.html