|
@@ -25,6 +25,12 @@
|
|
|
<a-button type="primary" class="my-4" @click="openTargetModal(4)"> 打开弹窗4 </a-button>
|
|
|
</a-space>
|
|
|
|
|
|
+ <Alert
|
|
|
+ message="使用函数方式创建Prompt,适合较为简单的表单内容,如果需要弹出较为复杂的内容,请使用 Modal."
|
|
|
+ show-icon
|
|
|
+ />
|
|
|
+ <a-button type="primary" class="my-4" @click="handleCreatePrompt"> Prompt </a-button>
|
|
|
+
|
|
|
<component :is="currentModal" v-model:visible="modalVisible" :userData="userData" />
|
|
|
|
|
|
<Modal1 @register="register1" :minHeight="100" />
|
|
@@ -35,7 +41,7 @@
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, shallowRef, ComponentOptions, ref, nextTick } from 'vue';
|
|
|
- import { Alert, Space } from 'ant-design-vue';
|
|
|
+ import { Alert, Space, message } from 'ant-design-vue';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import Modal1 from './Modal1.vue';
|
|
|
import Modal2 from './Modal2.vue';
|
|
@@ -43,6 +49,7 @@
|
|
|
import Modal4 from './Modal4.vue';
|
|
|
import { PageWrapper } from '/@/components/Page';
|
|
|
import { type Nullable } from '@vben/types';
|
|
|
+ import { createPrompt } from '/@/components/Prompt';
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: { Alert, Modal1, Modal2, Modal3, Modal4, PageWrapper, ASpace: Space },
|
|
@@ -93,6 +100,19 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function handleCreatePrompt() {
|
|
|
+ createPrompt({
|
|
|
+ title: '请输入邮箱',
|
|
|
+ required: true,
|
|
|
+ label: '邮箱',
|
|
|
+ defaultValue: '默认邮箱',
|
|
|
+ onOK: async (email: string) => {
|
|
|
+ message.success('填写的邮箱地址为' + email);
|
|
|
+ },
|
|
|
+ inputType: 'Input',
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
register1,
|
|
|
openModal1,
|
|
@@ -108,6 +128,7 @@
|
|
|
send,
|
|
|
currentModal,
|
|
|
openModalLoading,
|
|
|
+ handleCreatePrompt,
|
|
|
};
|
|
|
},
|
|
|
});
|