ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<script lang="ts">
import { defineComponent } from 'vue';
 
import { basicProps } from '../props';
 
export default defineComponent({
  emits: ['ok', 'continue', 'cancel'],
  name: 'BasicModalFooter',
  props: basicProps,
  setup(_, { emit }) {
    function handleOk(e: Event) {
      emit('ok', e);
    }
    function handleContinue(e: Event) {
      emit('continue', e);
    }
    function handleCancel(e: Event) {
      emit('cancel', e);
    }
 
    return { handleCancel, handleContinue, handleOk };
  },
});
</script>
<template>
  <div>
    <slot name="insertFooter"></slot>
    <a-button
      :disabled="confirmLoading"
      :loading="continueLoading"
      :type="continueType"
      @click="handleContinue"
      v-bind="continueButtonProps"
      v-if="showContinueBtn">
      {{ continueText }}
    </a-button>
    <a-button v-bind="cancelButtonProps" v-if="showCancelBtn" @click="handleCancel">
      {{ cancelText }}
    </a-button>
    <slot name="centerFooter"></slot>
    <a-button
      :loading="confirmLoading"
      :type="okType"
      @click="handleOk"
      v-bind="okButtonProps"
      v-if="showOkBtn"
      :disabled="okButtonProps?.disabled || continueLoading">
      {{ okText }}
    </a-button>
    <slot name="appendFooter"></slot>
  </div>
</template>