<template> <dialogBox title="新建材料信息" width="40%" isMain v-model="myValue" @closeDialog="closeDialog" @submitForm="handleSubmit" :isFullscreen="false"> <el-form :model="ruleForm" ref="ruleForm" label-width="120px"> <el-row> <el-col :span="24"> <el-form-item label="材料类型"> <el-input v-model="ruleForm.cllx"></el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="24"> <el-form-item label="材料名称"> <el-input v-model="ruleForm.clmc"></el-input> </el-form-item> </el-col> </el-row> </el-form> </dialogBox> </template> <script> export default { props: { value: { type: Boolean, default: false }, }, data () { return { myValue: this.value, ruleForm: { cllx: "", clmc: "", }, }; }, watch: { value (val) { this.myValue = val; }, }, methods: { closeDialog () { this.$emit("input", false); }, handleSubmit () { this.$parent.addSave(this.ruleForm); this.$emit("input", false); }, }, }; </script> <style scoped lang="scss"> .submit-button { text-align: center; height: 52px; padding-top: 10px; background-color: #fff; } </style>