一品网
  • 首页

vue3 中 provide/inject/InjectionKey


父传子,一般是用provide/inject来完成,传递复杂类型(对象、函数)需要先定义InjectionKey。

1、type.ts

2、App.vue中定义

 3、Helloworld.vue中使用

4、结果

 参考:

https://blog.csdn.net/SEKIRO_DJ/article/details/123884281

vue3

相关


vue2与vue3中全局配置axios的不同点

vue3中的watch与vue2中的watch的对比

vue3 使用 data、computed、methods

vue3 绑定多个model技巧之 抽取useVModel

Vue3 与 Vue2的不同之处一 简单介绍 Vue 核心最基本的功能

vue3 + ts详细教程

Vue3 + axios + vue-vben-admin 实现单文件上传功能

Vue3 + axios + vue-vben-admin 实现单文件上传功能

form-create 3.0 版本发布,好用的Vue3版本动态表单生成组件

vue3.0+vite+ts项目搭建-postcss-pxtorem 实现移动自适应(五)

element-plus引入无效 vue3

Vue3--ref 和 $refs 的使用

标签

一品网 冀ICP备14022925号-6