uNmAnNeR / imaskjs

vanilla javascript input mask
https://imask.js.org
MIT License
4.97k stars 259 forks source link

Rules to fill Latitude value #374

Closed PetroGromovo closed 4 years ago

PetroGromovo commented 4 years ago

Hello, In bootstrap-vue app I need to make editor for Latitude / longitude and I added imaskjs for my project but it does not work as I expect with mask :

                number_lat::{{ number_lat}}<br>
                <imask-input
                        v-model="number_lat"
                        :mask="Number"
                        radix="."
                        :unmask="false"
                        :scale="7"
                        :signed="false"
                        @accept="onAccept"
                        placeholder='Enter latitude here'
                        :from="-90"
                        :to="90"
                />

and data definition :

        data() {
            return {
                number_lat: 51.503,

I got error on page opened : vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in mounted hook: "Error: value should be string" and the rules do not permit to enter negative value and rage from to do not work.

Which is the valid way ?

    "bootstrap-vue": "^2.3.0",
    "store": "^2.0.12",
    "v-money": "^0.8.1",
    "vee-validate": "^3.2.1",
    "verte": "0.0.12",
    "vue": "^2.6.11",
    "vue-imask": "^6.0.5",

Thanks!

uNmAnNeR commented 4 years ago

@PetroGromovo hi, sorry, i am probably too late, but may be helpfull to someone else. :unmask="false" means that your model value should be a string.