Vue js,vue-element-ui使用概要

2110 ワード

#1   
plat_users.html:385 Uncaught TypeError: Cannot read property 'validate' of undefined
    at VueComponent.submitForm (plat_users.html:385)
    at Proxy.boundFn (vue.js:130)
    at click (eval at makeFunction (vue.js:8480), :2:5611)
    at VueComponent.invoker (vue.js:1948)
    at VueComponent.Vue.$emit (vue.js:2549)
    at VueComponent.handleClick (element-ui.js:3)
    at boundFn (vue.js:130)
    at HTMLButtonElement.invoker (vue.js:1948

@click=「submitForm(reviseForm)」のreviseFormに引用符が使用されていないためです.
正しいコードは次のとおりです.
を選択します.
#     return,            。
Vue js:
 
    this.$refs[formName].validate(function (valid) {
                    
                    if (!valid) {
                        return ; //     return           http post   。
                    }
                });
                
    //          return           
    this.$http.post('url', {username: 'james', 'pwd': 'james'}).then(function(res) {
        
    })
# issue -4: vue-element-ui    pagination,       ,         。

-- View --

  
-- Vue js --  
handleSizeChange: function (val) {
            var _this = this;
             this.$http.post('/user/index', {current: this.currentPage, size: val}).then(
              function (response) {
                    _this.paginate_res = response.body;
                    _this.tableData3 = response.body.data.users;
                    _this.total = response.body.data.total;
                    _this.pageSize = parseInt(response.body.data.size);

                }, function (response) {
                    this.$notify({
                        title: '      ',
                        message: '      ,     。=.=',
                        type: 'info'
                    });
                });
}