From b88004390013d826e5e0aff452ec1f9fb483d222 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 1 Nov 2025 21:19:05 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90mall=E3=80=91diy=20editor?= =?UTF-8?q?=20=E7=9A=84=20search-bar=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/search-bar/config.ts | 4 +- .../components/mobile/search-bar/index.vue | 48 +++---------------- .../components/mobile/search-bar/property.vue | 18 +++---- 3 files changed, 18 insertions(+), 52 deletions(-) diff --git a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/config.ts b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/config.ts index 01d5894d1..c471780e1 100644 --- a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/config.ts +++ b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/config.ts @@ -13,10 +13,10 @@ export interface SearchProperty { style: ComponentStyle; } -// 文字位置 +/** 文字位置 */ export type PlaceholderPosition = 'center' | 'left'; -// 定义组件 +/** 定义组件 */ export const component = { id: 'SearchBar', name: '搜索框', diff --git a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue index e7c770304..7463d7db6 100644 --- a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/index.vue +++ b/apps/web-ele/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-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/property.vue b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/property.vue index 5e1822078..4dca02da7 100644 --- a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/property.vue +++ b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/search-bar/property.vue @@ -11,6 +11,7 @@ import { ElCard, ElForm, ElFormItem, + ElInput, ElRadioButton, ElRadioGroup, ElSlider, @@ -18,7 +19,7 @@ import { ElTooltip, } from 'element-plus'; -import { Draggable } from '#/views/mall/promotion/components'; +import { ColorInput, Draggable } from '#/views/mall/promotion/components'; import ComponentContainerProperty from '../../component-container-property.vue'; @@ -26,10 +27,12 @@ import ComponentContainerProperty from '../../component-container-property.vue'; defineOptions({ name: 'SearchProperty' }); const props = defineProps<{ modelValue: SearchProperty }>(); + const emit = defineEmits(['update:modelValue']); + const formData = useVModel(props, 'modelValue', emit); -// 监听热词数组变化 +/** 监听热词数组变化 */ watch( () => formData.value.hotKeywords, (newVal) => { @@ -45,8 +48,7 @@ watch(