juareznasato / vuetify-money

vuetify-money
45 stars 23 forks source link

How to pass rules in component? #25

Open denisibanez opened 3 years ago

denisibanez commented 3 years ago

i try, but dont work:

`

        v-model="maxValuePerPeriod.value"
        v-bind:label="maxValuePerPeriod.label"
        v-bind:placeholder="maxValuePerPeriod.placeholder"
        v-bind:readonly="maxValuePerPeriod.readonly"
        v-bind:disabled="maxValuePerPeriod.disabled"
        v-bind:outlined="maxValuePerPeriod.outlined"
        v-bind:clearable="maxValuePerPeriod.clearable"
        v-bind:valueWhenIsEmpty="maxValuePerPeriod.valueWhenIsEmpty"
        v-bind:options="maxValuePerPeriod.options"
        v-bind:properties="maxValuePerPeriod.properties"        

maxValuePerPeriod: { label: "Valor máximo por período", value: null, placeholder: " ", readonly: false, disabled: false, outlined: false, clearable: false, valueWhenIsEmpty: "", options: { locale: "pt-BR", prefix: "", suffix: "", length: 11, precision: 2 }, properties: { rules: [value => !!value || 'Required.', value => (value && value.length >= 3) || 'Min 3 characters',] } }`

juareznasato commented 3 years ago

You can try this way:

maxValuePerPeriod: {
label: "Valor máximo por período",
value: null,
placeholder: " ",
readonly: false,
disabled: false,
outlined: false,
clearable: false,
valueWhenIsEmpty: "",
rules: "............."
options: {
locale: "pt-BR",
prefix: "",
suffix: "",
length: 11,
precision: 2
},
properties: {

}
}`