model.js 523 B

12345678910111213141516171819202122232425262728293031
  1. import { getElementId, randomCode, deepCopy } from "../../plugins/utils";
  2. const MODEL = {
  3. type: "TEXT",
  4. x: 0,
  5. y: 0,
  6. w: 200,
  7. h: 50,
  8. sign: "",
  9. fontWeight: 400,
  10. fontFamily: "宋体",
  11. fontSize: "14px",
  12. color: "#000",
  13. mode: "normal", // side:侧边模式,normal:正常模式
  14. content: [
  15. {
  16. type: "text",
  17. content: "样例内容",
  18. },
  19. ],
  20. };
  21. const getModel = () => {
  22. return {
  23. id: getElementId(),
  24. key: randomCode(),
  25. ...deepCopy(MODEL),
  26. };
  27. };
  28. export { MODEL, getModel };