Former-commit-id: a686cbec6aa82ccf0a5a2f738602d72ff3fa00e5 Former-commit-id: 7e986278ddb45ad7f2373e759f923148f92a3981 Former-commit-id: 4efa4699c64d12049ead46e050e95d495364516b
43 lines
1003 B
JavaScript
43 lines
1003 B
JavaScript
export default {
|
|
data () {
|
|
return {
|
|
layout: {
|
|
layout: [
|
|
{'x': 0, 'y': 0, 'w': 8, 'h': 9, 'i': '0'},
|
|
{'x': 8, 'y': 0, 'w': 4, 'h': 9, 'i': '1'},
|
|
{'x': 0, 'y': 9, 'w': 5, 'h': 7, 'i': '2'}
|
|
],
|
|
colNum: 12,
|
|
rowHeight: 30,
|
|
isDraggable: true,
|
|
isResizable: true,
|
|
isMirrored: false,
|
|
verticalCompact: true,
|
|
margin: [10, 10],
|
|
useCssTransforms: true
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
layoutUpdatedHandler (newLayout) {
|
|
console.group('layoutUpdatedHandler')
|
|
newLayout.forEach(e => {
|
|
console.log(`{'x': ${e.x}, 'y': ${e.y}, 'w': ${e.w}, 'h': ${e.h}, 'i': '${e.i}'},`)
|
|
})
|
|
console.groupEnd()
|
|
},
|
|
// 改变尺寸
|
|
resizeHandler (name) {
|
|
this.$nextTick(() => {
|
|
this.$refs[name].resize()
|
|
})
|
|
},
|
|
// 改变尺寸完成
|
|
resizedHandler (name) {
|
|
this.$nextTick(() => {
|
|
this.$refs[name].resize()
|
|
})
|
|
}
|
|
}
|
|
}
|