juareznasato / vuetify-mask Goto Github PK
View Code? Open in Web Editor NEWvuetify-mask
vuetify-mask
Like this AAA-99Z9, where A [A-Za-z], 9 [0-9] and Z accept both
Hi, how to use v-mask in template tag data-table
<template v-slot:[
item.usu_cpf]="{ item }"> <td> <span>{{ item.usu_cpf }}</span> </td> </template>
Hi!
I use v-text-field-simplemask. I add a directive
:error-messages="check_val"
but when the function check_val returns some value (example, "Must be filled"), the text box does not display an error and does not turn red.
Great library! I'm trying to prevent my v-text-field from updating the model/input until the @change event actually fires.
Is v-model required for masking to work? If it is and :value can't be used, do you have any ideas how to accomplish what I'm looking to do?
How to use mask format for postal code canada exmple t2v2x7
according to v-text-field
API, any attribute not listing in API doc will be passed down through the child tag which, in this case, is the input
tag. So, using <v-text-field inputmode="numeric"/>
will results in
... some other components...
<input inputmode="numeric" type="text" ... >
... closing tags
however the behavior of v-text-field-simplemask
just passing down inputmode
to v-text-field
tag which is not quite usable in my case.
It would be very useful adding the option hide-details int the v-bind:properties
single-line not working, background-color not working
Is there any way that I can use the component slots?
So far I've tried this:
<template>
<div>
<v-text-field-simplemask
v-model="value"
:label="computedLabel"
:properties="computedProperties"
:options="computedOptions"
:focus="focus"
@focus="focus = false"
>
<template #append>
<v-btn icon>
<v-icon>mdi-account</v-icon>
</v-btn>
</template>
</v-text-field-simplemask>
</div>
</template>
But no success with any of the available slot options in the v-text-field documentation.
When control is set on focus through tabindex, the entire control is highlighted. I think the correct behavior is to have the focus set such that its ready to accept user keyboard input.
<v-text-field-simplemask
label="Date of birth"
v-model="properties.dob"
v-bind:properties="{
readonly: false,
disabled: false,
outlined: true,
clearable: true,
placeholder: 'DD-MM-YYYY',
}"
v-bind:options="{
inputMask: '##-##-####',
outputMask: '##-##-####',
empty: null,
}"
v-on:keyup="keyup"
tabindex="39"
Good day,
I don't know why, but I got unexpected 0 in my phone number field
I don't have any 0 in my mask:
+49(####)###-#### - it's mask for screenshot
But I got +49(0 in field
<template>
<v-card flat width="60%">
<v-card-title class="font-weight-bold">Billing information</v-card-title>
<v-card-subtitle class="text-body-2">This information must be kept current to ensure your account continues to be active</v-card-subtitle>
<v-form>
<v-card-text>
<v-row class="pa-0">
<v-col class="py-0" cols="12" lg="6">
<v-text-field type="text" placeholder="First name" v-model="settings['first_name']"></v-text-field>
</v-col>
<v-col class="py-0" cols="12" lg="6">
<v-text-field type="text" placeholder="Last Name" v-model="settings['last_name']"></v-text-field>
</v-col>
</v-row>
<v-row class="pa-0">
<v-col class="py-0" cols="12" lg="12">
<v-text-field placeholder="Company Name"></v-text-field>
</v-col>
</v-row>
<v-row class="pa-0">
<v-col class="py-0" cols="12" lg="6">
<v-select placeholder="Country"
:items="settings.countries"
v-model="settings.address.country"
item-text="name"
item-value="code"></v-select>
</v-col>
<v-col class="py-0" cols="12" lg="6">
<v-text-field placeholder="State/Region"></v-text-field>
</v-col>
</v-row>
<v-row class="pa-0">
<v-col class="py-0" cols="12" lg="6">
<v-text-field placeholder="City"></v-text-field>
</v-col>
<v-col class="py-0" cols="12" lg="6">
<v-text-field placeholder="Postal Code"></v-text-field>
</v-col>
</v-row>
<v-row class="pa-0">
<v-col class="py-0" cols="12" lg="6">
<v-text-field placeholder="Street Address"></v-text-field>
</v-col>
<v-col class="py-0" cols="12" lg="6">
<v-text-field placeholder="Suite/Unit"></v-text-field>
</v-col>
</v-row>
<v-row class="pa-0">
<v-col class="py-0" cols="12" lg="6">
<masked-input-field-component
v-model="phoneNumber"
label="Phone Number"
placeholder="Phone number"
v-bind:properties="{
readonly: false,
disabled: false,
outlined: false,
clearable: true,
}"
v-bind:options="{
humanMask: phoneMask,
machineMask: '###########',
empty: null,
applyAfter: false,
alphanumeric: true,
lowerCase: false,
}"
/>
</v-col>
<v-col class="py-0" cols="12" lg="6">
<v-text-field placeholder="VAT ID"></v-text-field>
</v-col>
</v-row>
</v-card-text>
<v-card-actions class="px-4">
<v-btn type="submit" color="primary">Save Settings</v-btn>
</v-card-actions>
</v-form>
</v-card>
</template>
<script>
import countries from "@/static/countries.json"
import MaskedInputFieldComponent from "../MaskedInputFieldComponent";
export default {
name: "SettingsTabContent",
components: {MaskedInputFieldComponent},
props: {
billingData: Object
},
data () {
return {
countries: countries
}
},
mounted() {
},
methods: {
},
computed: {
settings () {
return this.billingData
},
phoneMask () {
// eslint-disable-next-line no-prototype-builtins
if (this.settings.address.country && this.countries['phoneMask'].hasOwnProperty(this.settings.address.country) ) {
return this.countries['phoneMask'][this.settings.address.country]
} else {
return this.countries['phoneMask']['DE']
}
},
phoneNumber: {
get () {
return this.settings.phone_number
},
set (value) {
this.settings.phone_number = value
}
}
}
}
</script>
<style scoped>
</style>
I use dynamic input mask based on country code that I choose in select field
What am I doing wrong?
Hi there
Do you perhaps have a compiled CDN version for this?
Thanks
I got this error "Unknown custom element: "
v-text-field-integer on mobile does not prevent entering comma and periods on mobile while on desktop only numbers are allowed
Juarez,
Tua lib é bem bacana, para mim falta poucos detalhes para ser excelente, falta usar diretamente as Rules ( pelo que vi já tem um PR que resolve isto) e aceitar números negativos, pois em aplicações financeiras e outras é bem usada.
Espero que logo resolva estes pequenos detalhes.
Forte abraço ai.
Great package!
One nice-to-have feature would be if you could dynamically allow the precision when a user types a dot. I think that would allow a better UX. Lots of times the decimals aren't needed and can be annoying to type 00 (or however many you set) before getting to a whole number. Is this possible?
Boa tarde @juareznasato.
Estou tentando utilizar seu componente com o Vuetify 3, mas sempre que insiro um valor e o componente perde o foco o valor volta para "R$ 0,00".
Estou utilizando o seu exemplo deixado no ReadMe.
Obrigado
Add rules to the text-fields, thanks
Hey, what's the best way to set rules in cnpj field?
<v-text-field-cnpj
v-model="form.cnpj"
label="CNPJ"
class="ml-md-2"
v-bind:properties='{
rules: "[v => !!v || 'CNPJ é obrigatório']" // not working
rules: "[rules.cnpj.required]" // not working
}'
v-bind:options="{
outputMask: '##############',
}"
></v-text-field-cnpj>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.