type
status
date
tags
category
icon
password
setup
context对象的成员
成员 | 类型 | 说明 |
attrs | 对象 | 同 vue2 的this.$attrs |
slots | 对象 | 同 vue2 的this.$slots |
emit | 方法 | 同 vue2 的this.$emit |
生命周期函数
vue2 option api | vue3 option api | vue 3 composition api |
beforeCreate | beforeCreate | 不再需要,代码可直接置于setup中 |
created | created | 不再需要,代码可直接置于setup中 |
beforeMount | beforeMount | onBeforeMount |
mounted | mounted | onMounted |
beforeUpdate | beforeUpdate | onBeforeUpdate |
updated | updated | onUpdated |
beforeDestroy | ==改== beforeUnmount | onBeforeUnmount |
destroyed | ==改==unmounted | onUnmounted |
errorCaptured | errorCaptured | onErrorCaptured |
- | ==新==renderTracked | onRenderTracked |
- | ==新==renderTriggered | onRenderTriggered |
新增钩子函数说明:
钩子函数 | 参数 | 执行时机 |
renderTracked | DebuggerEvent | 渲染vdom收集到的每一次依赖时 |
renderTriggered | DebuggerEvent | 某个依赖变化导致组件重新渲染时 |
DebuggerEvent:
- target: 跟踪或触发渲染的对象
- key: 跟踪或触发渲染的属性
- type: 跟踪或触发渲染的方式
- Author:杨敢敢
- URL:http://preview.tangly1024.com/article/1adac6ee-e22b-817e-8c76-c84343fcd6dd
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts