定义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();
            }
        });


Logo

前往低代码交流专区

更多推荐