通过provide和inject函数可以简便的实现跨级组件通讯
父组件提供
const count = ref(0);
provide('count', count);
const updateCount = (num) => {
count.value += num;
};
provide('updateCount', updateCount);
子组件或者孙子组件接受
const count = inject('count');
const updateCount = inject('updateCount');
t(‘updateCount’);