model.js 440 B

1234567891011121314151617181920212223242526272829
  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. fontSize: "14px",
  11. color: "#000",
  12. content: [
  13. {
  14. type: "text",
  15. content: "样例内容",
  16. },
  17. ],
  18. };
  19. const getModel = () => {
  20. return {
  21. id: getElementId(),
  22. key: randomCode(),
  23. ...deepCopy(MODEL),
  24. };
  25. };
  26. export { MODEL, getModel };