publicConfig.ts 502 B

1234567891011121314151617181920
  1. import { getUUID } from '@/utils'
  2. import { PublicConfigType } from '@/packages/index.d'
  3. export class publicConfig implements PublicConfigType {
  4. public id = getUUID()
  5. // 重命名
  6. public rename = undefined
  7. // 基本信息
  8. public attr = { x: 0, y: 0, w: 500, h: 300, zIndex: -1 }
  9. // 基本样式(动画,透明)
  10. public styles = {
  11. opacity: 1,
  12. animations: []
  13. }
  14. // 设置坐标
  15. public setPosition(x: number, y: number): void {
  16. this.attr.x = x
  17. this.attr.y = y
  18. }
  19. }