摘要:
关于Vue3里面的getCurrentInstance:可以获取挂载在全局的属性和获取上下文 这里会碰到几个问题: 一、不能使用getCurrentInstance的ctx 我们在获取Vue3中全局挂载的方法时会这么写: 这里的ctx不是setup提供的ctx const { ctx } = get 阅读全文
摘要:
最近用vue3 重构vue2.x的项目,真是一坑未平,一波又起,话不多说 上代码 <template> <div>{{ loadingStatus }}</div> </template> ... setup(props, context) { // @ts-ignore const { proxy 阅读全文
摘要:
子组件 child.vue <template> <div> <p>hello world</p> <button @click="handleClick">click</button> </div> </template> <script lang="ts"> import { defineCom 阅读全文