赞
踩
1.注意绑定的model用:model 加上ref
<el-form label-width="180px" :model="Form" label-position="top" ref="Form">
<el-row>
<el-col class="m10-right1" :span="8">
<el-form-item prop="bsid" label="编号" :rules="[{required: true,message: '请输入设备编号',trigger: 'blur',},]">
<el-input v-model="Form.bsid" style="width:300px"></el-input>
<el-tag type="info" class="tagclass">:{{parameterCopy.bsid}}</el-tag>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-button class="savebox" size="medium" type="primary" @click="saveClick">保存</el-button>
</el-row>
</el-form>
2.注意加上prop才能判断
//保存 saveClick(){ var formItems=this.parameterForm this.$refs.Form.validate().then(valdid => { if (!valdid) { return } this.$axios.post("", formItems).then((res) => { if (res.data == "配置成功") { this.$message({ type: 'success', message: '配置成功!' }) } else { this.$message.error('配置失败'); } }).catch(error => { this.$message.error('请检查链接'); }) }) }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。