63 lines
1.3 KiB
Vue
63 lines
1.3 KiB
Vue
<docs>
|
|
---
|
|
order: 11
|
|
title:
|
|
zh-CN: 自定义页脚按钮属性
|
|
en-US: Customize footer buttons props
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
传入 `okButtonProps` 和 `cancelButtonProps` 可分别自定义确定按钮和取消按钮的 props。
|
|
|
|
## en-US
|
|
|
|
Passing `okButtonProps` and `cancelButtonProps` can customize the ok button and cancel button props.
|
|
|
|
</docs>
|
|
|
|
<template>
|
|
<div>
|
|
<a-button type="primary" @click="showModal">Open Modal with customized button props</a-button>
|
|
<a-modal
|
|
v-model:visible="visible"
|
|
title="Basic Modal"
|
|
:ok-button-props="{ disabled: true }"
|
|
:cancel-button-props="{ disabled: true }"
|
|
@ok="handleOk"
|
|
>
|
|
<p>Some contents...</p>
|
|
<p>Some contents...</p>
|
|
<p>Some contents...</p>
|
|
</a-modal>
|
|
</div>
|
|
</template>
|
|
<script lang="ts">
|
|
import { defineComponent, ref } from 'vue';
|
|
export default defineComponent({
|
|
setup() {
|
|
const visible = ref<boolean>(false);
|
|
|
|
const showModal = () => {
|
|
visible.value = true;
|
|
};
|
|
|
|
const handleOk = (e: MouseEvent) => {
|
|
console.log(e);
|
|
visible.value = false;
|
|
};
|
|
|
|
const handleCancel = (e: MouseEvent) => {
|
|
console.log(e);
|
|
visible.value = false;
|
|
};
|
|
return {
|
|
visible,
|
|
showModal,
|
|
handleOk,
|
|
handleCancel,
|
|
};
|
|
},
|
|
});
|
|
</script>
|