vue nextTick使用场景与原理 |
您所在的位置:网站首页 › nexttick使用场景 › vue nextTick使用场景与原理 |
使用场景 1、created里面操作dom 例子 Hello World ~ 点击 export default { methods: { get() { } }, mounted() { console.log(333); console.log(this.$refs['hello']); this.$nextTick(() => { console.log(444); console.log(this.$refs['hello']); }); }, created() { console.log(111); console.log(this.$refs['hello']); this.$nextTick(() => { console.log(222); console.log(this.$refs['hello']); }); } }控制台输出 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |