JSFiddle - React, Tailwind, and code Playground
by ChangJoo Park
HTML
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
<div id="app">
<div v-ob>{{ counter }}</div>
<button @click="change">CHANGE</button>
</div>
JavaScript
Vue.directive('ob', {
// 바인딩 된 엘리먼트가 DOM에 삽입되었을 때...
inserted: function(el) {
console.log('inserted')
},
bind: function(el) {},
update: function(el) {
console.log('update called => ', el)
}
})
new Vue({
el: '#app',
data() {
return {
counter: 1
}
},
methods: {
change() {
this.counter++
}
}
})
window.requestIdleCallback(() => {
console.log('requestIdleCallback')
})