签到完成
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
<slot v-if="$scopedSlots.btn" name="btn"/>
|
||||
<el-button v-else type="text">{{ text }}</el-button>
|
||||
</div>
|
||||
<ai-dialog :visible.sync="dialog" :title="dialogTitle" :width="width" :customFooter="customFooter" v-on="$listeners"
|
||||
@onConfirm="dialog=false,$emit('onConfirm')" v-bind="$attrs">
|
||||
<ai-dialog :visible.sync="dialog" :title="dialogTitle" :width="width" :customFooter="needFooter" v-on="$listeners"
|
||||
@onConfirm="handleConfirm" v-bind="$attrs">
|
||||
<slot/>
|
||||
<template #footer>
|
||||
<el-button @click="dialog=false">关闭</el-button>
|
||||
@@ -21,12 +21,26 @@ export default {
|
||||
text: {default: "点击弹窗"},
|
||||
dialogTitle: {default: "展示信息"},
|
||||
customFooter: {default: true},
|
||||
width: {default: "1200px"}
|
||||
width: {default: "1200px"},
|
||||
submit: {default: null}
|
||||
},
|
||||
computed: {
|
||||
needFooter: v => v.customFooter && !v.submit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialog: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
if (!this.submit) {
|
||||
this.dialog = false
|
||||
this.$emit('onConfirm')
|
||||
} else {
|
||||
this.submit?.()?.then(() => this.dialog = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user