1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > vue组件加载完成之后执行方法_vuejs实现ready函数加载完之后执行某个函数的方法...

vue组件加载完成之后执行方法_vuejs实现ready函数加载完之后执行某个函数的方法...

时间:2021-07-30 19:00:45

相关推荐

vue组件加载完成之后执行方法_vuejs实现ready函数加载完之后执行某个函数的方法...

编程之家收集整理的这篇文章主要介绍了vuejs实现ready函数加载完之后执行某个函数的方法,编程之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

vue.js 教程

Vue.js(读音 /vjuː/,类似于 view) 是一套构建用户界面的渐进式框架。

Vue 只关注视图层, 采用自底向上增量开发的设计。

Vue 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件。

我期望vue中tds全都渲染在界面上之后,再调用一个函数(其实这个函数主要作用是给表格中的选择框加监听,如果tds没有渲染,那监听也加不上去)。

日期

任务

是否执行

执行结果

影响行数

执行时间

执行时长

成功率

操作

尝试了

无效,在tds未展示在界面上时就alert了。

尝试了

也无效,在tds未展示在界面上时就alert了。

最后解决办法是增加一个vm.$watch('tds',function(val){ })函数,在vm改变后调用nextTick,最终可以在tds展示在界面之后调用我想要的函数。

');

// $.getJSON("http://m./Api/rerunMonitor",{"monitorID": monitor_id},function (result) {

// console.log(result);

// vm.isupdate=(this.isupdate==0?1:0);

// button.html('重跑');

// button.prop('disabled',false);

// });

$.ajax({

url: "http://m./Api/rerunMonitor",// The name of the callback parameter,as specified by the YQL service

jsonp: "callback",// Tell jQuery we're expecting JSONP

dataType: "jsonp",// Tell YQL what we want and that we want JSON

data: {

monitorID: monitor_id

},// Work with the response

success: function (response) {

console.log(response); // server response

vm.isupdate = (vm.isupdate == 0 ? 1 : 0);

button.html('重跑');

button.prop('disabled',false);

}

});

}

}

})

vm.$watch('start',function (val) {

$.getJSON("/main/getMonitor",{"beginDate": val,"endDate": this.end},function (result) {

vm.tds = result;

});

})

vm.$watch('end',{"beginDate": this.start,"endDate": val},function (result) {

vm.tds = result;

});

})

vm.$watch('isupdate',function (result) {

vm.tds = result;

});

})

vm.$watch('tds',function(val){

vm.$nextTick(function() {

initTableCheckbox();

});

})

总结

以上所述是小编给大家介绍的vuejs实现ready函数加载完之后执行某个函数的方法。编程之家 收集整理的教程希望能对你有所帮助,如果觉得编程之家不错,可分享给好友!感谢支持。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。