From edfdee8cc1f3030df613fdddf7a64de7924d69a2 Mon Sep 17 00:00:00 2001 From: owen Date: Sat, 9 Dec 2023 21:33:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6=E3=80=90?= =?UTF-8?q?=E6=82=AC=E6=B5=AE=E6=8C=89=E9=92=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/FloatingActionButton/config.ts | 36 +++++++++ .../mobile/FloatingActionButton/index.vue | 74 +++++++++++++++++++ .../mobile/FloatingActionButton/property.vue | 44 +++++++++++ src/components/DiyEditor/util.ts | 10 ++- 4 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 src/components/DiyEditor/components/mobile/FloatingActionButton/config.ts create mode 100644 src/components/DiyEditor/components/mobile/FloatingActionButton/index.vue create mode 100644 src/components/DiyEditor/components/mobile/FloatingActionButton/property.vue diff --git a/src/components/DiyEditor/components/mobile/FloatingActionButton/config.ts b/src/components/DiyEditor/components/mobile/FloatingActionButton/config.ts new file mode 100644 index 00000000..fcf129f1 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/FloatingActionButton/config.ts @@ -0,0 +1,36 @@ +import { DiyComponent } from '@/components/DiyEditor/util' + +// 悬浮按钮属性 +export interface FloatingActionButtonProperty { + // 展开方向 + direction: 'horizontal' | 'vertical' + // 是否显示文字 + showText: boolean + // 按钮列表 + list: FloatingActionButtonItemProperty[] +} + +// 悬浮按钮项属性 +export interface FloatingActionButtonItemProperty { + // 图片地址 + imgUrl: string + // 跳转连接 + url: string + // 文字 + text: string + // 文字颜色 + textColor: string +} + +// 定义组件 +export const component = { + id: 'FloatingActionButton', + name: '悬浮按钮', + icon: 'tabler:float-right', + position: 'fixed', + property: { + direction: 'vertical', + showText: true, + list: [{ textColor: '#fff' }] + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/FloatingActionButton/index.vue b/src/components/DiyEditor/components/mobile/FloatingActionButton/index.vue new file mode 100644 index 00000000..19e42cb6 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/FloatingActionButton/index.vue @@ -0,0 +1,74 @@ + + + + diff --git a/src/components/DiyEditor/components/mobile/FloatingActionButton/property.vue b/src/components/DiyEditor/components/mobile/FloatingActionButton/property.vue new file mode 100644 index 00000000..5db08d0e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/FloatingActionButton/property.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 5dbe5955..940ece4a 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -111,7 +111,15 @@ export const PAGE_LIBS = [ { name: '基础组件', extended: true, - components: ['SearchBar', 'NoticeBar', 'MenuSwiper', 'MenuGrid', 'MenuList', 'Popover'] + components: [ + 'SearchBar', + 'NoticeBar', + 'MenuSwiper', + 'MenuGrid', + 'MenuList', + 'Popover', + 'FloatingActionButton' + ] }, { name: '图文组件',