组合式语法应当还可以更好 #11981
Replies: 3 comments
-
|
Beta Was this translation helpful? Give feedback.
-
variable.watch 这已经不是组合了,这是继承 |
Beta Was this translation helpful? Give feedback.
-
composition API,个人理解是一种类函数式编程范式。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
1:const variable =ref({number:1,string:"test"}) 改为 ref variable = {number:1,string:"test"}
2:组合式API中的 watch(variable ,(newval,oldval)=>{代码片段}) 改为 variable.watch((new,old,deep,immediate)=>{代码片段}) 或者watch.variable(代码片段);对于只监听单个属性的 可以 variable.number.watch(代码片段)
Beta Was this translation helpful? Give feedback.
All reactions