From fadad35b202862e15f834838c8c08434891ff4b5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 10 Nov 2025 19:13:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd=E3=80=91?= =?UTF-8?q?=E3=80=90mall=E3=80=91diy-editor=20=E4=BB=A3=E7=A0=81=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC=E7=BB=9F=E4=B8=80=20&=20=E9=80=90=E4=B8=AA=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=2020%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/product/category/components/index.ts | 1 + ...product-category-select.vue => select.vue} | 12 ++--- .../components/app-link-input/index.vue | 3 +- ...nk-select-dialog.vue => select-dialog.vue} | 53 ++++++++----------- .../components/mobile/Carousel/index.vue | 53 ------------------- .../mobile/{Carousel => carousel}/config.ts | 0 .../components/mobile/carousel/index.vue | 53 +++++++++++++++++++ .../{Carousel => carousel}/property.vue | 4 +- .../mobile/{Divider => divider}/config.ts | 0 .../mobile/{Divider => divider}/index.vue | 0 .../mobile/{Divider => divider}/property.vue | 0 .../components/mobile/menu-swiper/index.vue | 24 ++++----- .../mobile/{Popover => popover}/config.ts | 0 .../mobile/{Popover => popover}/index.vue | 0 .../mobile/{Popover => popover}/property.vue | 0 .../components/mobile/product-list/index.vue | 34 ++++++------ .../mobile/product-list/property.vue | 13 +++-- .../components/mobile/search-bar/index.vue | 42 ++------------- .../components/mobile/tab-bar/index.vue | 46 ++++------------ .../components/mobile/tab-bar/property.vue | 9 ++-- .../components/mobile/user-card/property.vue | 4 +- .../components/mobile/user-coupon/config.ts | 5 +- .../components/mobile/user-order/index.vue | 3 +- .../components/mobile/user-order/property.vue | 4 +- .../components/mobile/user-wallet/index.vue | 3 +- .../mobile/user-wallet/property.vue | 4 +- .../mobile/video-player/property.vue | 4 +- .../promotion/components/diy-editor/index.vue | 8 +++ .../promotion/components/draggable/index.vue | 15 ++---- .../components/magic-cube-editor/index.vue | 5 +- .../vertical-button-group/index.vue | 4 +- .../mall/product/category/components/index.ts | 2 +- .../{category-select.vue => select.vue} | 0 .../components/app-link-input/index.vue | 1 - .../components/mobile/carousel/property.vue | 2 +- .../components/mobile/product-card/config.ts | 2 +- .../components/mobile/product-list/index.vue | 4 +- .../components/mobile/search-bar/config.ts | 2 +- .../components/mobile/search-bar/index.vue | 7 +-- .../components/mobile/tab-bar/index.vue | 6 +-- .../components/mobile/tab-bar/property.vue | 2 +- .../components/mobile/user-coupon/config.ts | 7 ++- .../components/mobile/user-order/config.ts | 2 +- .../components/mobile/user-wallet/config.ts | 2 +- .../components/mobile/video-player/config.ts | 2 +- .../promotion/components/draggable/index.vue | 7 ++- .../components/magic-cube-editor/index.vue | 4 +- 47 files changed, 195 insertions(+), 263 deletions(-) create mode 100644 apps/web-antd/src/views/mall/product/category/components/index.ts rename apps/web-antd/src/views/mall/product/category/components/{product-category-select.vue => select.vue} (94%) rename apps/web-antd/src/views/mall/promotion/components/app-link-input/{app-link-select-dialog.vue => select-dialog.vue} (87%) delete mode 100644 apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/index.vue rename apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/{Carousel => carousel}/config.ts (100%) create mode 100644 apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/index.vue rename apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/{Carousel => carousel}/property.vue (99%) rename apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/{Divider => divider}/config.ts (100%) rename apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/{Divider => divider}/index.vue (100%) rename apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/{Divider => divider}/property.vue (100%) rename apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/{Popover => popover}/config.ts (100%) rename apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/{Popover => popover}/index.vue (100%) rename apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/{Popover => popover}/property.vue (100%) rename apps/web-ele/src/views/mall/product/category/components/{category-select.vue => select.vue} (100%) diff --git a/apps/web-antd/src/views/mall/product/category/components/index.ts b/apps/web-antd/src/views/mall/product/category/components/index.ts new file mode 100644 index 000000000..c3196cb27 --- /dev/null +++ b/apps/web-antd/src/views/mall/product/category/components/index.ts @@ -0,0 +1 @@ +export { default as ProductCategorySelect } from './select.vue'; diff --git a/apps/web-antd/src/views/mall/product/category/components/product-category-select.vue b/apps/web-antd/src/views/mall/product/category/components/select.vue similarity index 94% rename from apps/web-antd/src/views/mall/product/category/components/product-category-select.vue rename to apps/web-antd/src/views/mall/product/category/components/select.vue index a55a66a43..cbaf3ec65 100644 --- a/apps/web-antd/src/views/mall/product/category/components/product-category-select.vue +++ b/apps/web-antd/src/views/mall/product/category/components/select.vue @@ -11,26 +11,25 @@ import { getCategoryList } from '#/api/mall/product/category'; defineOptions({ name: 'ProductCategorySelect' }); const props = defineProps({ - // 选中的ID modelValue: { type: [Number, Array], default: undefined, - }, - // 是否多选 + }, // 选中的 ID multiple: { type: Boolean, default: false, - }, - // 上级品类的编号 + }, // 是否多选 parentId: { type: Number, default: undefined, - }, + }, // 上级品类的编号 }); /** 分类选择 */ const emit = defineEmits(['update:modelValue']); +const categoryList = ref([]); // 分类树 + /** 选中的分类 ID */ const selectCategoryId = computed({ get: () => { @@ -42,7 +41,6 @@ const selectCategoryId = computed({ }); /** 初始化 */ -const categoryList = ref([]); // 分类树 onMounted(async () => { const data = await getCategoryList({ parentId: props.parentId, diff --git a/apps/web-antd/src/views/mall/promotion/components/app-link-input/index.vue b/apps/web-antd/src/views/mall/promotion/components/app-link-input/index.vue index 3391a41cf..b4125104b 100644 --- a/apps/web-antd/src/views/mall/promotion/components/app-link-input/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/app-link-input/index.vue @@ -3,7 +3,7 @@ import { ref, watch } from 'vue'; import { Button, Input } from 'ant-design-vue'; -import AppLinkSelectDialog from './app-link-select-dialog.vue'; +import AppLinkSelectDialog from './select-dialog.vue'; /** APP 链接输入框 */ defineOptions({ name: 'AppLinkInput' }); @@ -56,5 +56,6 @@ watch( + diff --git a/apps/web-antd/src/views/mall/promotion/components/app-link-input/app-link-select-dialog.vue b/apps/web-antd/src/views/mall/promotion/components/app-link-input/select-dialog.vue similarity index 87% rename from apps/web-antd/src/views/mall/promotion/components/app-link-input/app-link-select-dialog.vue rename to apps/web-antd/src/views/mall/promotion/components/app-link-input/select-dialog.vue index 949087212..27405557b 100644 --- a/apps/web-antd/src/views/mall/promotion/components/app-link-input/app-link-select-dialog.vue +++ b/apps/web-antd/src/views/mall/promotion/components/app-link-input/select-dialog.vue @@ -3,11 +3,12 @@ import type { AppLink } from './data'; import { nextTick, ref } from 'vue'; +import { useVbenModal } from '@vben/common-ui'; import { getUrlNumberValue } from '@vben/utils'; -import { Button, Form, FormItem, Modal, Tooltip } from 'ant-design-vue'; +import { Button, Form, FormItem, Tooltip } from 'ant-design-vue'; -import ProductCategorySelect from '#/views/mall/product/category/components/product-category-select.vue'; +import { ProductCategorySelect } from '#/views/mall/product/category/components/'; import { APP_LINK_GROUP_LIST, APP_LINK_TYPE_ENUM } from './data'; @@ -30,21 +31,31 @@ const groupBtnRefs = ref([]); // 分组引用列表 const detailSelectDialog = ref<{ id?: number; type?: APP_LINK_TYPE_ENUM; - visible: boolean; }>({ - visible: false, id: undefined, type: undefined, }); // 详情选择对话框 -const dialogVisible = ref(false); +const [Modal, modalApi] = useVbenModal({ + onConfirm() { + emit('change', activeAppLink.value.path); + emit('appLinkChange', activeAppLink.value); + modalApi.close(); + }, +}); + +const [DetailSelectModal, detailSelectModalApi] = useVbenModal({ + onConfirm() { + detailSelectModalApi.close(); + }, +}); defineExpose({ open }); /** 打开弹窗 */ async function open(link: string) { activeAppLink.value.path = link; - dialogVisible.value = true; + modalApi.open(); // 滚动到当前的链接 const group = APP_LINK_GROUP_LIST.find((group) => group.links.some((linkItem) => { @@ -76,7 +87,7 @@ function handleAppLinkSelected(appLink: AppLink) { 'id', `http://127.0.0.1${activeAppLink.value.path}`, ) || undefined; - detailSelectDialog.value.visible = true; + detailSelectModalApi.open(); break; } default: { @@ -85,13 +96,6 @@ function handleAppLinkSelected(appLink: AppLink) { } } -/** 处理确认提交 */ -function handleSubmit() { - emit('change', activeAppLink.value.path); - emit('appLinkChange', activeAppLink.value); - dialogVisible.value = false; -} - /** * 处理右侧链接列表滚动 * @@ -138,7 +142,7 @@ function scrollToGroupBtn(group: string) { /** 是否为相同的链接(不比较参数,只比较链接) */ function isSameLink(link1: string, link2: string) { - return link2 ? link1.split('?')[0] === link2.split('?')[0] : false; + return link2 ? link1?.split('?')[0] === link2.split('?')[0] : false; } /** 处理详情选择 */ @@ -149,17 +153,12 @@ function handleProductCategorySelected(id: number) { activeAppLink.value.path = `${url.pathname}${url.search}`; // 关闭对话框,并重置 id - detailSelectDialog.value.visible = false; + detailSelectModalApi.close(); detailSelectDialog.value.id = undefined; } - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/index.vue deleted file mode 100644 index 9b4dd5c16..000000000 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/index.vue +++ /dev/null @@ -1,53 +0,0 @@ - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/config.ts similarity index 100% rename from apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/config.ts rename to apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/config.ts diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/index.vue new file mode 100644 index 000000000..0b05db2e2 --- /dev/null +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/index.vue @@ -0,0 +1,53 @@ + + diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/property.vue similarity index 99% rename from apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/property.vue rename to apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/property.vue index 9cace5f26..d7a90e806 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Carousel/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/carousel/property.vue @@ -21,11 +21,13 @@ import { AppLinkInput, Draggable } from '#/views/mall/promotion/components'; import ComponentContainerProperty from '../../component-container-property.vue'; -// 轮播图属性面板 +/** 轮播图属性面板 */ defineOptions({ name: 'CarouselProperty' }); const props = defineProps<{ modelValue: CarouselProperty }>(); + const emit = defineEmits(['update:modelValue']); + const formData = useVModel(props, 'modelValue', emit); diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/divider/config.ts similarity index 100% rename from apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/config.ts rename to apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/divider/config.ts diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/divider/index.vue similarity index 100% rename from apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/index.vue rename to apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/divider/index.vue diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/divider/property.vue similarity index 100% rename from apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Divider/property.vue rename to apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/divider/property.vue diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-swiper/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-swiper/index.vue index 0dcd9d468..160441b71 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-swiper/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/menu-swiper/index.vue @@ -8,21 +8,17 @@ import { Image } from 'ant-design-vue'; /** 菜单导航 */ defineOptions({ name: 'MenuSwiper' }); const props = defineProps<{ property: MenuSwiperProperty }>(); -// 标题的高度 -const TITLE_HEIGHT = 20; -// 图标的高度 -const ICON_SIZE = 32; -// 垂直间距:一行上下的间距 -const SPACE_Y = 16; -// 分页 -const pages = ref([]); -// 轮播图高度 -const carouselHeight = ref(0); -// 行高 -const rowHeight = ref(0); -// 列宽 -const columnWidth = ref(''); +const TITLE_HEIGHT = 20; // 标题的高度 +const ICON_SIZE = 32; // 图标的高度 +const SPACE_Y = 16; // 垂直间距:一行上下的间距 + +const pages = ref([]); // 分页 +const carouselHeight = ref(0); // 轮播图高度 + +const rowHeight = ref(0); // 行高 +const columnWidth = ref(''); // 列宽 + watch( () => props.property, () => { diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/popover/config.ts similarity index 100% rename from apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/config.ts rename to apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/popover/config.ts diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/popover/index.vue similarity index 100% rename from apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/index.vue rename to apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/popover/index.vue diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/popover/property.vue similarity index 100% rename from apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/Popover/property.vue rename to apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/popover/property.vue diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-list/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-list/index.vue index 446b78b61..063f795c9 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-list/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-list/index.vue @@ -13,10 +13,11 @@ import { getSpuDetailList } from '#/api/mall/product/spu'; /** 商品栏 */ defineOptions({ name: 'ProductList' }); -// 定义属性 + const props = defineProps<{ property: ProductListProperty }>(); -// 商品列表 + const spuList = ref([]); + watch( () => props.property.spuIds, async () => { @@ -27,19 +28,15 @@ watch( deep: true, }, ); -// 手机宽度 -const phoneWidth = ref(384); -// 容器 -const containerRef = ref(); -// 商品的列数 -const columns = ref(2); -// 滚动条宽度 -const scrollbarWidth = ref('100%'); -// 商品图大小 -const imageSize = ref('0'); -// 商品网络列数 -const gridTemplateColumns = ref(''); -// 计算布局参数 + +const phoneWidth = ref(375); // 手机宽度 +const containerRef = ref(); // 容器 +const columns = ref(2); // 商品的列数 +const scrollbarWidth = ref('100%'); // 滚动条宽度 +const imageSize = ref('0'); // 商品图大小 +const gridTemplateColumns = ref(''); // 商品网络列数 + +/** 计算布局参数 */ watch( () => [props.property, phoneWidth, spuList.value.length], () => { @@ -69,9 +66,10 @@ watch( }, { immediate: true, deep: true }, ); + +/** 初始化 */ onMounted(() => { - // 提取手机宽度 - phoneWidth.value = containerRef.value?.wrapRef?.offsetWidth || 384; + phoneWidth.value = containerRef.value?.wrapRef?.offsetWidth || 375; }); - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-list/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-list/property.vue index 6b069e07c..7984bfff0 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-list/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-list/property.vue @@ -17,17 +17,18 @@ import { } from 'ant-design-vue'; import UploadImg from '#/components/upload/image-upload.vue'; -import { InputWithColor as ColorInput } from '#/views/mall/promotion/components'; +import SpuShowcase from '#/views/mall/product/spu/components/spu-showcase.vue'; +import { ColorInput } from '#/views/mall/promotion/components'; import ComponentContainerProperty from '../../component-container-property.vue'; -// TODO: 添加组件 -// import SpuShowcase from '#/views/mall/product/spu/components/spu-showcase.vue'; -// 商品栏属性面板 +/** 商品栏属性面板 */ defineOptions({ name: 'ProductListProperty' }); const props = defineProps<{ modelValue: ProductListProperty }>(); + const emit = defineEmits(['update:modelValue']); + const formData = useVModel(props, 'modelValue', emit); @@ -39,7 +40,7 @@ const formData = useVModel(props, 'modelValue', emit); :model="formData" > - + @@ -117,5 +118,3 @@ const formData = useVModel(props, 'modelValue', emit); - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue index 2a3ec9bce..8d44dd79e 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue @@ -5,19 +5,19 @@ import { IconifyIcon } from '@vben/icons'; /** 搜索框 */ defineOptions({ name: 'SearchBar' }); + defineProps<{ property: SearchProperty }>(); - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue index 90747a4ed..1f0eeab08 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue @@ -11,9 +11,9 @@ defineOptions({ name: 'TabBar' }); defineProps<{ property: TabBarProperty }>(); - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/property.vue index ec0cb01c7..324414cec 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/property.vue @@ -22,7 +22,8 @@ import { } from '#/views/mall/promotion/components'; import { component, THEME_LIST } from './config'; -// 底部导航栏 + +/** 底部导航栏 */ defineOptions({ name: 'TabBarProperty' }); const props = defineProps<{ modelValue: TabBarProperty }>(); @@ -32,7 +33,7 @@ const formData = useVModel(props, 'modelValue', emit); // 将数据库的值更新到右侧属性栏 component.property.items = formData.value.items; -// 要的主题 +/** 处理主题变更 */ const handleThemeChange = () => { const theme = THEME_LIST.find((theme) => theme.id === formData.value.theme); if (theme?.color) { @@ -42,7 +43,7 @@ const handleThemeChange = () => { - - diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-card/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-card/property.vue index bad6c2e53..46a0e16c5 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-card/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-card/property.vue @@ -5,11 +5,13 @@ import { useVModel } from '@vueuse/core'; import ComponentContainerProperty from '../../component-container-property.vue'; -// 用户卡片属性面板 +/** 用户卡片属性面板 */ defineOptions({ name: 'UserCardProperty' }); const props = defineProps<{ modelValue: UserCardProperty }>(); + const emit = defineEmits(['update:modelValue']); + const formData = useVModel(props, 'modelValue', emit); diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-coupon/config.ts b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-coupon/config.ts index c81926481..4666980ea 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-coupon/config.ts +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-coupon/config.ts @@ -2,11 +2,10 @@ import type { ComponentStyle, DiyComponent } from '../../../util'; /** 用户卡券属性 */ export interface UserCouponProperty { - // 组件样式 - style: ComponentStyle; + style: ComponentStyle; // 组件样式 } -// 定义组件 +/** 定义组件 */ export const component = { id: 'UserCoupon', name: '用户卡券', diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-order/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-order/index.vue index 1451ac12d..073883447 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-order/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/user-order/index.vue @@ -5,7 +5,8 @@ import { Image } from 'ant-design-vue'; /** 用户订单 */ defineOptions({ name: 'UserOrder' }); -// 定义属性 + +/** 定义属性 */ defineProps<{ property: UserOrderProperty }>(); - +