vue2 + Composition API 实践
响应式API
ref
unref
toRef
toRefs
isRef
customRef
shallowRef
triggerRef
computed
watch
watchEffect
1、解构带来的响应式陷阱
我们习惯了ES6的对象解构风格,但这在composition- api里可能会有陷阱。因为结构可能会让你的响应式对象失去预期中的响应特性。
<template>
<div id="app">
{{count}}
<button @click=
原创
2022-01-25 15:32:00 ·
1633 阅读 ·
0 评论