mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
Added maxAdaprive(Width/Height) props
This commit is contained in:
@@ -69,6 +69,20 @@
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
|
adaptiveMaxWidth: {
|
||||||
|
type: Number,
|
||||||
|
default: 1,
|
||||||
|
validator (value) {
|
||||||
|
return value > 0 && value <= 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
adaptiveMaxHeight: {
|
||||||
|
type: Number,
|
||||||
|
default: 1,
|
||||||
|
validator (value) {
|
||||||
|
return value > 0 && value <= 1
|
||||||
|
}
|
||||||
|
}
|
||||||
width: {
|
width: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 600
|
default: 600
|
||||||
@@ -219,8 +233,14 @@
|
|||||||
|
|
||||||
adaptSize () {
|
adaptSize () {
|
||||||
if (this.adaptive) {
|
if (this.adaptive) {
|
||||||
this.modal.width = inRange(0, this.window.width, this.modal.width)
|
this.modal.width = inRange(
|
||||||
this.modal.height = inRange(0, this.window.height, this.modal.height)
|
0,
|
||||||
|
this.window.width * this.maxAdaptiveWidth,
|
||||||
|
this.modal.width)
|
||||||
|
this.modal.height = inRange(
|
||||||
|
0,
|
||||||
|
this.window.height * this.maxAdaptiveWidth,
|
||||||
|
this.modal.height)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user