Commit f9519ecc5e348034dbac6dcef992b75c30895836
1 parent
411e2c96
Exists in
master
and in
3 other branches
feat: 优化表单校验事件及修复确认框不兼容性更新
Showing
2 changed files
with
10 additions
and
2 deletions
Show diff stats
packages/form/index.vue
| ... | ... | @@ -157,9 +157,10 @@ export default { |
| 157 | 157 | /** |
| 158 | 158 | * @description 校验表单 |
| 159 | 159 | */ |
| 160 | - validate() { | |
| 160 | + validate(cb) { | |
| 161 | 161 | return new Promise(resolve => { |
| 162 | 162 | this.$refs.form.validate(valid => { |
| 163 | + cb && cb(valid); | |
| 163 | 164 | this.$emit('validate', valid, this.model); |
| 164 | 165 | return resolve(valid); |
| 165 | 166 | }); | ... | ... |
packages/scheme/index.vue
| ... | ... | @@ -68,7 +68,14 @@ |
| 68 | 68 | <div class="zee-scheme__table-operation" slot-scope="slotScope"> |
| 69 | 69 | <slot name="operation-button" v-bind="{ ..._slotScope, slotScope }"></slot> |
| 70 | 70 | <el-button type="text" icon="el-icon-edit" title="编辑" @click="openEdit(slotScope.row)"></el-button> |
| 71 | - <el-popconfirm confirmButtonText="确定" cancelButtonText="取消" title="确定删除吗?" placement="top" @onConfirm="handleDelete([slotScope.row])"> | |
| 71 | + <el-popconfirm | |
| 72 | + confirmButtonText="确定" | |
| 73 | + cancelButtonText="取消" | |
| 74 | + title="确定删除吗?" | |
| 75 | + placement="top" | |
| 76 | + @confirm="handleDelete([slotScope.row])" | |
| 77 | + @onConfirm="handleDelete([slotScope.row])" | |
| 78 | + > | |
| 72 | 79 | <el-button slot="reference" type="text" icon="el-icon-delete" title="删除"></el-button> |
| 73 | 80 | </el-popconfirm> |
| 74 | 81 | <slot name="operation-button-append" v-bind="{ ..._slotScope, slotScope }"></slot> | ... | ... |