provide(提供依赖) inject(注入依赖)
这对选项需要一起使用,以允许一个祖先组件向其所有子孙后代注入一个依赖,不论组件层次有多深,并在起上下游关系成立的时间里始终生效。如果你熟悉 React,这与 React 的上下文特性很相似。---官网上的解释
传送门
定义依赖
第一步(app.vue文件)


第二步

哪里使用哪个页面刷新(videoPlay.vue)


原理
利用app.vue 页面的数据(isRouterAlive)变动,拉动router-view中的dom强制渲染!
网友评论