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