鍍金池/ 問答/HTML/ Vue methods 使用AJAX后不停的請求后臺?

Vue methods 使用AJAX后不停的請求后臺?

  var vm = new Vue({
    el: '#app',
    data: {
        nowpage:0,
        typenum:1
    }, 
    methods:{  
        test: function () {             
            $.ajax({
                url: "/xxx/xxx",
                data: {
                    PageNum: this.nowpage,
                    PageSize: this.typenum
                },
                type: "post",
                dataType: "json",
                success: function (data) {
                    ...
                     //加載pagination分頁控件
                      $.jqPaginator('#pagination', {
                      ...
                      });
                    }
            });          
        }
    }
});
vm.test();
    這樣導(dǎo)致了我不停的在請求后臺,請問下為什么。
    才接觸vue,希望能詳細(xì)的解釋一下。
回答
編輯回答
喜歡你

Vue.js 和 pagination控件的回調(diào)函數(shù)沖突了,解決的辦法暫時沒想好。換成自己手動寫的分頁

2017年5月31日 00:19