父组件
setup () {
const data = reactive({
deviceTypesTotal: {}
})
provide('deviceTypesTotal', data.deviceTypesTotal)
子组件
import { defineComponent, reactive, toRefs, ref, onMounted, inject , watch } from 'vue'
const deviceTypesTotal = inject('deviceTypesTotal')
watch(deviceTypesTotal, (newValue) => {
console.log(newValue)
data.deviceTypesTotal = newValue.deviceTypesTotal
},{deep:true})
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。