fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Base {
  constructor (attr) {
    this.id = `id-${new Date().getTime()}`
    this.x = attr.x
    this.y = attr.y
    this.w = attr.w
    this.h = attr.h
    this.z = attr.z
    this.type = attr.type || ''
    this.title = attr.title
  }
 
  pxToVw (px = 0) {
    return px / 375 * 100 + 'vw'
  }
}
export default Base