浏览代码

公共组件调整按钮

zhengnaiwen_citu 6 月之前
父节点
当前提交
890b2b0f1d
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/components/AutoComponents/MDialog/index.vue

+ 7 - 2
src/components/AutoComponents/MDialog/index.vue

@@ -13,8 +13,13 @@
   >
     <slot></slot>
     <span slot="footer" v-if="!hideFooter">
-      <m-button @click="show = false">{{ option?.textCancel ?? '取 消'}}</m-button>
-      <m-button :type="option?.colorSure ?? 'orange'" @click="sure">{{ option?.textSure ?? '确 定'}}</m-button>
+      <template v-if="$listeners.sure">
+        <m-button @click="show = false">{{ option?.textCancel ?? '取 消'}}</m-button>
+        <m-button :type="option?.colorSure ?? 'orange'" @click="sure">{{ option?.textSure ?? '确 定'}}</m-button>
+      </template>
+      <template v-else>
+        <m-button @click="show = false">关 闭</m-button>
+      </template>
       <slot name="button-after"></slot>
     </span>
   </el-dialog>