vue3实现祖先向下面组件传值

import {provide,ref} from "vue"
let car = ref("奔驰")
祖: provide("car",car)

子孙:
import {inject} from "vue"
let car = inject("car")

你可能感兴趣的:(vue3实现祖先向下面组件传值)