Vue解析五之mounted
在mounted获得vue的实例要加this.$nextTick(function () {// 代码保证 this.$el 在 document 中})mounted: function () {this.$nextTick(function () {// 代码保证 this.$el 在 document 中console.log(vm)})}
·
在mounted获得vue的实例要加
this.$nextTick(function () {
// 代码保证 this.$el 在 document 中
})
mounted: function () {
this.$nextTick(function () {
// 代码保证 this.$el 在 document 中
console.log(vm)
})
}
更多推荐
已为社区贡献2条内容
所有评论(0)