4 小时以前 16697df76d7b27ff65d229937b3f3ac4cc0e56a0
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>
@@ -51,7 +55,7 @@
})
// 详情模式不展示“确认”按钮,其它类型正常显示
const showConfirm = computed(() => props.operationType !== 'detail')
const showConfirm = computed(() => props.operationType !== 'detail' && props.operationType !== 'view')
const computedTitle = computed(() => {
  if (typeof props.title === 'function') {