SOURCE

console 命令行工具 X clear

                    
>
console
var Test = {
    data() {
        return {
            numberValidateForm: {
                age: ''
            }
        };
    },
    methods: {
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    alert('submit!');
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },
        resetForm(formName) {
            this.$refs[formName].resetFields();
        }
    }
}
var Test = Vue.extend(Test);
new Test().$mount('#app')
<div id="app">
    <el-form :model="numberValidateForm" ref="numberValidateForm" label-width="100px"
    class="demo-ruleForm">
        <el-form-item label="年龄" prop="age" :rules="[
        { required: true, message: '年龄不能为空'},
        { type: 'number', message: '年龄必须为数字值'}
        ]">
            <el-input type="age" v-model.number="numberValidateForm.age" auto-complete="off">
            </el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="submitForm('numberValidateForm')">
                提交
            </el-button>
            <el-button @click="resetForm('numberValidateForm')">
                重置
            </el-button>
        </el-form-item>
    </el-form>
    <el-row :gutter="20">
  <el-col :span="12"><div class="grid-content bg-purple"></div></el-col>
  <el-col :span="12"><div class="grid-content bg-purple"></div></el-col>
  <el-col :span="6"><div class="grid-content bg-purple"></div></el-col>
  <el-col :span="6"><div class="grid-content bg-purple"></div></el-col>
</el-row>
</div>

本项目引用的自定义外部资源