ng effects
1.0.0
笔记 | 该存储库不再维护。这个故事在Angular Coption API上持续。 |
角度的反应性系统。基于VUE组成API。
API参考⚡stackblitz changelog
笔记 | 寻找以前的(9.0.x)文档?点击这里。 |
@ Component ( {
selector : "app-root" ,
inputs : [ "count" ] ,
outputs : [ "countChange" ]
} )
export class AppComponent extends defineComponent ( ( ) => {
const count = ref ( 0 )
const countChange = new EventEmitter < number > ( )
function increment ( ) {
count . value += 1
}
watchEffect ( ( ) => {
countChange . emit ( count . value )
} )
return {
count ,
countChange ,
increment ,
}
} ) { } 通过NPM安装
npm install ng-effects