|
|
@ -53,10 +53,10 @@ import VueDragResize from 'vue-drag-resize' |
|
|
|
return window.outerHeight; |
|
|
|
}, |
|
|
|
isDraggable() { |
|
|
|
return true; |
|
|
|
return this.isMax ? false : true; |
|
|
|
}, |
|
|
|
isResizable() { |
|
|
|
return true; |
|
|
|
return this.isMax ? false : true; |
|
|
|
}, |
|
|
|
isTitle() { |
|
|
|
return true; |
|
|
@ -71,6 +71,7 @@ import VueDragResize from 'vue-drag-resize' |
|
|
|
data() { |
|
|
|
|
|
|
|
return { |
|
|
|
// 是否最大化 |
|
|
|
isMax:false, |
|
|
|
isDestory:false, |
|
|
|
showSizeChoice: false, |
|
|
@ -80,6 +81,7 @@ import VueDragResize from 'vue-drag-resize' |
|
|
|
height: Math.round(window.innerHeight * .6), |
|
|
|
top: Math.round(window.innerHeight * .2), |
|
|
|
left: Math.round(window.innerWidth * .2), |
|
|
|
_style: {}, // 缓存最大化之前的数据 |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -93,11 +95,29 @@ import VueDragResize from 'vue-drag-resize' |
|
|
|
this.curHeight = newRect.height; |
|
|
|
}, |
|
|
|
onMaxSize(){ |
|
|
|
this.$refs.dragEl.$el.style.left = 0 |
|
|
|
this.$refs.dragEl.$el.style.top = 0 |
|
|
|
const $contentEl = this.$refs.dragEl.$el.firstChild |
|
|
|
$contentEl.style.width = window.innerWidth + 'px' |
|
|
|
$contentEl.style.height = window.innerHeight + 'px' |
|
|
|
this.isMax = !this.isMax |
|
|
|
|
|
|
|
const $dragEl = this.$refs.dragEl.$el |
|
|
|
const $contentEl = $dragEl.firstChild |
|
|
|
// 最大化 |
|
|
|
if (this.isMax) { |
|
|
|
this._style = { |
|
|
|
width: this.width, |
|
|
|
height: this.height, |
|
|
|
left: this.left, |
|
|
|
top: this.top |
|
|
|
} |
|
|
|
$dragEl.style.left = 0 |
|
|
|
$dragEl.style.top = 0 |
|
|
|
$contentEl.style.width = window.innerWidth + 'px' |
|
|
|
$contentEl.style.height = window.innerHeight + 'px' |
|
|
|
} |
|
|
|
else { |
|
|
|
$dragEl.style.left = this._style.left |
|
|
|
$dragEl.style.top = this._style.top |
|
|
|
$contentEl.style.width = this._style.width + 'px' |
|
|
|
$contentEl.style.height = this._style.height + 'px' |
|
|
|
} |
|
|
|
return; |
|
|
|
this.isMax = !this.isMax; |
|
|
|
this.left = 0 |
|
|
|