Skip to content

Change maskΒ #15

@dulingleb

Description

@dulingleb
<input type="text" class="form-control" id="phone" name="phone" v-mask="phone.mask" :placeholder="phone.placeholder" required>

setPhoneCode: function (country) {
                switch (country) {
                    case 'rus':
                        this.phone.flag = 'πŸ‡·πŸ‡Ί ';
                        this.phone.code = '+7';
                        this.phone.placeholder = '(___) ___-__-__';
                        this.phone.mask = '(999) 999-99-99';
                        break;
                    case 'kzt':
                        this.phone.flag = 'πŸ‡°πŸ‡Ώ ';
                        this.phone.code = '+7';
                        this.phone.placeholder = '(___) ___-__-__';
                        this.phone.mask = '(999) 999-99-99';
                        break;
                    case 'uk':
                        this.phone.flag = 'πŸ‡ΊπŸ‡¦ ';
                        this.phone.code = '+380';
                        this.phone.placeholder = '(__) ___-__-__';
                        this.phone.mask = '(99) 999-99-99';
                        break;
                    case 'by':
                        this.phone.flag = 'πŸ‡§πŸ‡Ύ ';
                        this.phone.code = '+375';
                        this.phone.placeholder = '(__) ___-__-__';
                        this.phone.mask = '(99) 999-99-99';
                        break;
                }
            }

Don't work v-mask="phone.mask" when i change country
What i can do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions