vue中在页面渲染完之后获取元素
两种方法
方法一:使用$nextTick,在异步获得数据之后再获取元素
方法二:在then之后再获取该元素
.then(function (response) {
_self.topic = response.data;
}).then(()=>{
if(!GenerateContentList()){
_self.showMenuCard = false;
}
我用的方法二
- Post Title: vue中在页面渲染完之后获取元素
- Post Author: HeRui
- Post Link: https://HR2812.cn/2019/06/01/vue-get-element-after-rendering/
- Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.