组合式语法应当还可以更好 #11981
15953835029
started this conversation in
Ideas
组合式语法应当还可以更好
#11981
Replies: 3 comments
|
|
0 replies
|
variable.watch 这已经不是组合了,这是继承 |
0 replies
composition API,个人理解是一种类函数式编程范式。 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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(代码片段)
All reactions