LikeVue
原因:策略模式的应用, 场景在ts 里使用vue的api,现应用于ng 中实现watch PS:此项目初级阶段也是使用了vue2的核心代码,没有使用vue3的原因是没有必要监听当前设想如此
Use vue api in ts, now used to implement watch in ng
全部开源
Links/相关链接
掘金 https://juejin.im/post/5df9fdec6fb9a0163d1a6748
Features
-
支持场景
- ng ts
- react
- other
技术栈(当前)
- 前端:[ts,js]
Project setup
npm install like-vue
Example
import {LikeVue} from 'like-vue';
export class TestComponent implements OnInit {
@LikeVue()
$watch() {
return {
// 监听的属性
"prop":(newValue,oldValue)=>{
// do something
}
};
}
}
Thanks
https://github.com/vuejs