vue渲染后触发事件
定义vuevar collegeContent = new Vue({el: "#collegeContent",data: {colleges: []},});异步获取数据,渲染$.ajax({url: '../api/collegeData.do',ty...
·
定义vue
var collegeContent = new Vue({
el: "#collegeContent",
data: {
colleges: []
},
});
异步获取数据,渲染
$.ajax({
url: '../api/collegeData.do',
type: 'get',
data: {
page: page,
pageSize: pageSize
},
success: function (data) {
collegeContent.colleges = data.data;
collegeContent.$nextTick(function(){//渲染完成后触发事件
$('.list div').on('mouseleave',function(){ $(this).find('.mask').css({"animation" :'back .5s forwards',
"-webkit-animation" :'back .5s forwards'}) });
$('.list div').on('mouseenter',function(){ $(this).find('.mask').css({"animation" :'mask .5s forwards',
"-webkit-animation" :'mask .5s forwards'}) });
});
changePageView(Math.ceil(total / pageSize), page);
pageClick();
},
error: function () {
$('#page').hide();
}
});
更多推荐
已为社区贡献3条内容
所有评论(0)