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: '图文组件',