<div id="app"></div>
<script>
var vm = new Vue({
el:'#app',
template:"<div> {{test}}</div>",
data:{
test:'hello world'
},
//
beforeCreate:function () {
console.log("beforeCreate")
},
created:function () {
console.log('created')
},
beforeMount:function () {
console.log(this.$el)
console.log('beforeMount')
},
mounted:function () {
console.log(this.$el)
console.log('mounted')
},
// destroy方法调用之前调用
beforeDestroy:function () {
console.log('beforeDestroy')
},
// destroy方法调用之后调用
destroyed:function () {
console.log('destroyed')
},
// date数据改变之前调用
beforeUpdate:function () {
console.log('beforeUpdate')
},
// date数据改变之后调用
update:function () {
console.log('update')
}
})
</script>
网友评论