Vben
2021-06-11 1c1755cf5b4ada7263c05ddf4105abb52a2abb2f
提交 | 用户 | age
ebf7c8 1 <template>
V 2   <div>
9edc28 3     <slot name="insertFooter"></slot>
ebf7c8 4     <a-button v-bind="cancelButtonProps" @click="handleCancel" v-if="showCancelBtn">
V 5       {{ cancelText }}
6     </a-button>
9edc28 7     <slot name="centerFooter"></slot>
ebf7c8 8     <a-button
V 9       :type="okType"
10       @click="handleOk"
11       :loading="confirmLoading"
12       v-bind="okButtonProps"
13       v-if="showOkBtn"
14     >
15       {{ okText }}
16     </a-button>
9edc28 17     <slot name="appendFooter"></slot>
ebf7c8 18   </div>
V 19 </template>
20 <script lang="ts">
21   import { defineComponent } from 'vue';
22
23   import { basicProps } from '../props';
24   export default defineComponent({
25     name: 'BasicModalFooter',
26     props: basicProps,
27     emits: ['ok', 'cancel'],
28     setup(_, { emit }) {
de12ba 29       function handleOk(e: Event) {
30         emit('ok', e);
ebf7c8 31       }
V 32
de12ba 33       function handleCancel(e: Event) {
34         emit('cancel', e);
ebf7c8 35       }
1c1755 36
ebf7c8 37       return { handleOk, handleCancel };
V 38     },
39   });
40 </script>