Last updated 2 years ago
Vue中provide/inject的值不是响应式的,如果想做成响应式,可以通过对数据进行包装:
vue2:使用Vue.observable()
vue3:使用ref/reactive,演示
参见: