Browse Source

公共组件调整按钮

zhengnaiwen_citu 6 tháng trước cách đây
mục cha
commit
890b2b0f1d
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  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>