首页 > 教程
Ant Design Vue 4.0 a-modal弹窗组件封装
- 2025-04-07
- 974 ℃
父组件(部分)
<template>
<div>
<a-button
type="primary"
ghost
@click="dialogPanelStatus.signIngInfoStatus = true"
>签约信息</a-button
>
</div>
<!-- 签约信息 -->
<SigningInfo
:signIngInfoStatus="dialogPanelStatus.signIngInfoStatus"
:walletData="walletData"
@closeDialog="closeDialog"
/>
</template>
<script setup>
import SigningInfo from "@/components/Income/SigningInfo.vue";
// DIalog弹窗状态
const dialogPanelStatus = reactive<DialogPanelStatus>({
signIngInfoStatus: false,
});
// 数据重载
const getMyWalletFn = () => {
// 数据重载
};
// 关闭弹窗
const closeDialog = (k: keyof DialogPanelStatus, rest: boolean) => {
dialogPanelStatus[k] = false;
rest && getMyWalletFn(true);
};
</script>
<style scoped>
@import "Income.less";
</style>弹窗子组件
<template>
<a-modal
:open="visible"
title="弹框"
:footer="null"
destroyOnClose
:maskClosable="false"
@cancel="closeDialogFn(false)"
>
<div>
<a-card size="small" hoverable>
<p>真实姓名:{{ walletData.real_name }}</p>
</a-card>
<a-card size="small" hoverable>
<p>身份证号:{{ walletData.card_number }}</p>
</a-card>
<a-card size="small" hoverable>
<p>支付宝账号:{{ walletData.alipay_account }}</p>
</a-card>
<a-card size="small" hoverable>
<p>支付宝姓名:{{ walletData.alipay_name }}</p>
</a-card>
</div>
</a-modal>
</template>
<script setup>
import { toRefs } from "vue";
import type { WalletData } from "@/types/index";
const props = withDefaults(
defineProps<{
visible: Boolean;
walletData: WalletData;
}>(),
{},
);
const { visible, walletData } = toRefs(props);
// 关闭弹窗
const emits = defineEmits(["closeDialog"]);
const closeDialogFn = (rest: boolean = false) => {
emits("closeDialog", "visibleStatus", rest);
};
</script>
<style scoped>
@import "SigningInfo.less";
</style>相关内容
微信让女朋友无法删除拉...
网页用JS屏蔽各种按键代码
PHP简单的Curl的Get请求...
实用的JavaScript一行代码
微信小程序原生wx.reques...
phpMyAdmin导入超大数据...
网页HTML特殊字符编码对照表
微信开小号辅助注册避免...
-
怎样在淘宝买东西最便宜
2021-11-22 655
-
DeepSeek最强使用攻略,放弃复杂提示词,直接提问效果反而更好?
2025-04-30 1286
-
微信深度清理,一次清理好几个G
2025-03-04 1386
-
Win7和Win10系统隐藏的上帝模式开启方法
2021-10-27 644
-
原生JS简易计算器
2025-04-07 1101
-
php提高性能的几个小技巧
2021-04-13 740
-
原型继承和 Class 继承
2025-04-07 842
-
微信小程序登陆封装
2025-04-07 1043
-
PHP判断URL的合法性字符串是否为 URL 链接
2025-04-07 863
-
CSS动态渐变彩色文字代码
2025-04-07 1269
文章评论 (0)
- 这篇文章还没有收到评论,赶紧来抢沙发吧~


进入有缘空间
点击分享文章