import { useEditor } from "@/modules/editor"; import { DesignComp } from "@/modules/editor/objects/DesignTemp/DesignComp"; import { css } from "@linaria/core"; import { defineComponent, toRaw, watch } from "vue"; import { any } from "vue-types"; import { Divider } from "ant-design-vue"; import { AlignComp, FontFamily, FontSize, FontStyleWapper, LetterSpacingComp, LineHeightComp, TextToolItem, TextColor, TextStroke, } from "./TextToolComp"; export const TextToolForm = defineComponent({ props: { component: any().isRequired, }, setup(props) { const { controls } = useEditor(); const changeVal = (e: { dataIndex: string; value: any }) => { let editor = controls.textEditorCtrl.state.currEditor; if (!editor) { return; } editor = toRaw(editor); editor.execute(e.dataIndex, e.value); console.log("change", e); setTimeout(() => { const selection = window.getSelection(); selection?.removeAllRanges(); editor.editing.view.focus(); }, 100); }; return () => { return (
文本
颜色
描边
); }; }, }); const formRowItem = css` display: flex; align-items: center; margin-bottom: 14px; &:last-child { margin-bottom: 0; } `; const FormLabelItem = css` display: flex; align-items: center; .label { min-width: 60px; margin-right: 10px; user-select: none; font-size: 12px; color: rgba(255, 255, 255, 0.8); } `;