I am trying to use provide/inject reactivity in vue 2. I was following this source. As it explains I added Vue.config.unwrapInjectedRef = true
in the main.js
file.
Finally inside the parent component I added this.
import { computed } from "vue";
provide() {
return {
DatasetDTO: computed(() => this.DatasetDTO),
};
},
but I am getting "export 'computed' was not found in 'vue'
warning.
How should I resolve it.
CodePudding user response:
you are referencing the docs for Vue 3. Follow the Vue 2 doc instructions for provide/inject here and here