watch
https://ryuzuka.github.io/VUE/tutorial/20_watch.html
data의 변경에 반응하는 일반적인 방법, 감시자 역할을 한다.
new Vue({
data () {
return {
count: 0
}
},
watch: {
count () {
console.log( 'count - watch' )
}
},
created () {
this.$watch( 'count', function () {
console.log( 'count - watch' )
});
}
}).$mount( '#app' )
'Vue' 카테고리의 다른 글
es6-promise (0) | 2023.05.19 |
---|---|
vuex (0) | 2019.02.24 |
vue-router (0) | 2019.02.23 |
axios (0) | 2019.02.23 |
트랜지션 (0) | 2019.02.10 |