model.js 460 B

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