diff --git a/src/App.vue b/src/App.vue index 6feeac0..2c7a76e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,17 +1,16 @@ diff --git a/src/components/editor/blocks/date/index.ts b/src/components/editor/blocks/date/index.ts new file mode 100644 index 0000000..2a33077 --- /dev/null +++ b/src/components/editor/blocks/date/index.ts @@ -0,0 +1,42 @@ +import { defineBlocker } from "../../config"; +import { DateData } from "./interface"; +import Option from "./option.vue"; +import Render from "./render.vue"; + +export default defineBlocker({ + type: "date", + icon: "icon-park-outline-calendar", + title: "日期组件", + description: "文字", + render: Render, + option: Option, + initial: { + id: "", + type: "date", + x: 0, + y: 0, + w: 300, + h: 100, + xFixed: false, + yFixed: false, + bgImage: "", + bgColor: "", + meta: {}, + actived: false, + resizable: true, + draggable: true, + data: { + format: "YYYY-MM-DD", + fontCh: { + content: "请输入文字", + family: "微软雅黑", + size: 14, + color: "#000000", + bold: false, + italic: false, + underline: false, + align: 3, + }, + }, + }, +}); diff --git a/src/components/editor/blocks/date/interface.ts b/src/components/editor/blocks/date/interface.ts new file mode 100644 index 0000000..c05638e --- /dev/null +++ b/src/components/editor/blocks/date/interface.ts @@ -0,0 +1,9 @@ +import { Font } from "../font"; + +export interface DateData { + /** + * 日期格式 + */ + format: 'YYYY-MM-DD' | 'YYYY年MM月DD日'; + fontCh: Font; +} \ No newline at end of file diff --git a/src/components/editor/blocks/date/option.vue b/src/components/editor/blocks/date/option.vue new file mode 100644 index 0000000..63f7f2d --- /dev/null +++ b/src/components/editor/blocks/date/option.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/editor/blocks/date/render.vue b/src/components/editor/blocks/date/render.vue new file mode 100644 index 0000000..94a554f --- /dev/null +++ b/src/components/editor/blocks/date/render.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/components/editor/blocks/font/option.vue b/src/components/editor/blocks/font/option.vue index ff70001..95e3ff7 100644 --- a/src/components/editor/blocks/font/option.vue +++ b/src/components/editor/blocks/font/option.vue @@ -1,8 +1,10 @@