mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
Added a module to tokenize strings of format number_suffix, e.g. 100px
This commit is contained in:
@@ -96,7 +96,8 @@
|
||||
default: 600,
|
||||
validator (value) {
|
||||
if (typeof value === 'string') {
|
||||
return value.charAt(value.length-1) === '%' && !isNaN(parseFloat(value))
|
||||
return value.charAt(value.length-1) === '%'
|
||||
&& !isNaN(parseFloat(value))
|
||||
}
|
||||
|
||||
if (typeof value === 'number') {
|
||||
@@ -109,7 +110,8 @@
|
||||
default: 300,
|
||||
validator (value) {
|
||||
if (typeof value === 'string') {
|
||||
return value === 'auto' || (value.charAt(value.length-1) === '%' && !isNaN(parseFloat(value)))
|
||||
return (value.charAt(value.length-1) === '%'
|
||||
&& !isNaN(parseFloat(value)))
|
||||
}
|
||||
|
||||
if (typeof value === 'number') {
|
||||
|
||||
Reference in New Issue
Block a user