目 录
第1章 应用配置 1
1.1 errorHandler 1
1.2 warnHandler 5
1.3 globalProperties 8
1.4 isCustomElement 9
1.5 optionMergeStrategies 11
1.6 performance 13
第2章 应用API 15
2.1 component 15
2.2 config 17
2.3 directive 18
2.4 mixin 24
2.5 mount 28
2.6 provide 28
2.7 unmount 30
2.8 use 32
第3章 全局API 35
3.1 createApp 36
3.2 defineComponent 39
3.3 defineAsyncComponent 42
3.4 resolveComponent 46
3.5 resolveDynamicComponent 49
3.6 resolveDirective/withDirectives 50
3.7 createRenderer 53
3.8 nextTick 54
第4章 选项式API 57
4.1 Data 57
4.1.1 data属性 57
4.1.2 props属性 59
4.1.3 computed属性 59
4.1.4 methods属性 61
4.1.5 watch属性 63
4.1.6 emits属性 67
4.2 DOM 69
4.2.1 template 69
4.2.2 render 71
4.3 生命周期钩子 72
4.3.1 beforeCreate 72
4.3.2 created 74
4.3.3 beforeMount 75
4.3.4 mounted 77
4.3.5 beforeUpdate 77
4.3.6 updated 79
4.3.7 activated 80
4.3.8 deactivated 83
4.3.9 beforeUnmount/unmounted 84
4.3.10 errorCaptured 87
4.3.11 renderTracked/renderTriggered 89
4.4 选项/资源 91
4.4.1 directives 91
4.4.2 components 92
4.5 组合 94
4.5.1 mixins 94
4.5.2 extends 98
4.5.3 provide/inject 101
4.5.4 setup 107
4.6 杂项 107
4.6.1 name 107
4.6.2 delimiters 111
4.6.3 inheritAttrs 112
第5章 实例property 115
5.1 $data 115
5.2 $props 117
5.3 $el 119
5.4 $options 120
5.5 $parent 122
5.6 $root 124
5.7 $slots 127
5.8 $refs 130
5.9 $attrs 132
第6章 实例方法 139
6.1 $watch 139
6.2 $emit 141
6.3 $forceUpdate 143
6.4 $nextTick 146
第7章 指令 149
7.1 v-text 149
7.2 v-html 150
7.3 v-show 152
7.4 v-if 153
7.5 v-else/v-else-if 157
7.6 v-for 158
7.7 v-on 162
7.8 v-bind 166
7.9 v-model 168
7.10 v-slot 172
7.11 v-pre 180
7.12 v-cloak 181
7.13 v-once 182
7.14 v-is 185
第8章 特殊指令 192
8.1 key 192
8.2 ref 197
8.3 is 198
第9章 内置组件 202
9.1 component 202
9.2 transition 204
9.3 transition-group 208
9.4 keep-alive 210
9.5 slot 211
9.6 teleport 212
第10章 响应性API 217
10.1 响应式基础API 217
10.1.1 reactive 217
10.1.2 readonly 221
10.1.3 isProxy 222
10.1.4 isReactive 224
10.1.5 isReadonly 225
10.1.6 toRaw 226
10.1.7 markRaw 228
10.1.8 shallowReactive 229
10.1.9 shallowReadonly 232
10.2 refs 234
10.2.1 ref 234
10.2.2 unref 236
10.2.3 toRef 237
10.2.4 toRefs 239
10.2.5 isRef 241
10.2.6 customRef 242
10.2.7 shallowRef 244
10.2.8 triggerRef 247
10.3 computed与watch 248
10.3.1 computed 248
10.3.2 watchEffect 250
10.3.3 watch 251
第11章 组合式API 253
11.1 setup 253
11.2 生命周期钩子 262
11.3 provide/inject 263
11.4 getCurrentInstance 265
