mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-23 18:30:36 +03:00
width allow css units
This commit is contained in:
@@ -211,14 +211,10 @@ export default {
|
|||||||
return ''
|
return ''
|
||||||
},
|
},
|
||||||
computedWidth () {
|
computedWidth () {
|
||||||
if (typeof this.width === 'string' && this.width.match(/(px|%|rem|em|ex)$/)) {
|
if ((typeof this.width === 'string' && /^\d+$/.test(this.width)) || typeof this.width === 'number') {
|
||||||
return this.width
|
return this.width + 'px'
|
||||||
}
|
}
|
||||||
if (typeof this.width === 'string') {
|
return this.width
|
||||||
return this.width.replace(/\D/g,'') + 'px'
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.width + 'px'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user