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
|
|