ZN
4 天以前 b461c6527e3a85e9af59e7680e792bcb5ffb6b7e
src/components/Dialog/FormDialog.vue
@@ -8,14 +8,18 @@
    <slot></slot>
    <template #footer>
      <div class="dialog-footer">
        <el-button
          v-if="showConfirm"
          type="primary"
          @click="handleConfirm"
        >
          确认
        </el-button>
        <el-button @click="handleCancel">取消</el-button>
        <!-- 自定义按钮插槽 -->
        <slot name="footer">
          <!-- 默认按钮 -->
          <el-button
            v-if="showConfirm"
            type="primary"
            @click="handleConfirm"
          >
            确认
          </el-button>
          <el-button @click="handleCancel">取消</el-button>
        </slot>
      </div>
    </template>
  </el-dialog>