Vue3 开发新范式,不用`ref/reactive`,不用`ref.value`

查看 257|回复 32
zhudapaooo   
四不像了
zhennann
OP
  
在面向大型的业务开发场景中,需要两个层面的架构设计:
1. 与界面交互的架构,这个使用 vue3 setup 来做
2. 与业务相关的架构,这个使用 ioc 容器来做。大量的工程实践证明,在业务层面,class 比 function 好用很多
shizhibuyu2023   
很多年不写 class 了,你懂我意思吧
wu67   
不如叫 javue 或者 sprivue 算了...
zhennann
OP
  
@kneo 那么什么是反模式呢?为什么那么多人纠结用 ref 还是 reactive ,为什么有的地方推荐 ref 而不是 reactive ,为什么 ref.value 无法规避。为什么代码多了一样乱。
dai269619118   
为什么我还是觉得 vue2 好用
tikazyq   
开始想来吐槽闭门造车,但后来发现这个开源项目专业搞笑的
https://github.com/cabloy/cabloy-front/issues/1
---
Why is mother?
index.vue is just a facade used to define Vue component. After invoking the useMother function, the work is transferred to mother.ts. If necessary, the definitions of props, emits and slots are all in mother.ts, and most business logics will also be placed in mother.ts
This is just like the behavior of lions: the male lions are the facade, and the female lions do the work. Therefore, if you think of index.vue as father, then mother.ts is the one who actually does the work
coolcoffee   
相比.value ,我更不想写 this 。在 vue 里面写 jsx ,像比较方便的双向绑定都丢失了,写成两不像心智负担反而更大。
所以为啥不用 react 呢?
Rrrrrr   
我也觉得 react 好,搞了几年 vue2 再也不想写
zhennann
OP
  
@coolcoffee 为什么不用 react ?参见我上面的回复。在面向大型的业务开发场景中,需要两个层面的架构设计。否则,代码多了一定会乱
您需要登录后才可以回帖 登录 | 立即注册

返回顶部