| | |
| | | :okButtonProps="{ disabled: true }" |
| | | > |
| | | <a-button type="primary" @click="closeModal" class="mr-2"> 从内部关闭弹窗 </a-button> |
| | | <a-button type="primary" @click="setModalProps"> 从内部修改title </a-button> |
| | | <a-button type="primary" @click="setModalProps({ title: 'Modal New Title' })"> |
| | | 从内部修改title |
| | | </a-button> |
| | | </BasicModal> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent } from 'vue'; |
| | | import { BasicModal, useModalInner } from '/@/components/Modal'; |
| | | export default defineComponent({ |
| | | components: { BasicModal }, |
| | | setup() { |
| | | const [register, { closeModal, setModalProps }] = useModalInner(); |
| | | return { |
| | | register, |
| | | closeModal, |
| | | setModalProps: () => { |
| | | setModalProps({ title: 'Modal New Title' }); |
| | | }, |
| | | }; |
| | | }, |
| | | }); |
| | | <script lang="ts" setup> |
| | | import { BasicModal, useModalInner } from '@/components/Modal'; |
| | | |
| | | const [register, { closeModal, setModalProps }] = useModalInner(); |
| | | </script> |