正如How to know if rule is failing in vuetify's v-text-field?所解释的,我可以看到任何规则是否失败,模型值为<v-form>
。
另外,我想知道***哪个***规则属于multi-rule v-text-area。例如,对于以下组件,
<template>
<div>
<v-form v-model="valid">
<v-text-field
v-model="model"
type="number"
label="Fetch Frequency"
:rules="[rules.loanMin, rules.required]"
min="100"
suffix="seconds"
></v-text-field>
</v-form>
</div>
</template>
<script>
export default {
data: function(){
return {
device: "",
model: "",
item: "",
rules: {
required: v => !!v || 'Required.',
loanMin: v => (v && v >= 100) || 'minimum interval is 100 min',
}
}
}
}
</script>
有没有办法知道哪个规则(“required”或“loanMin”)正在下降?
1条答案
按热度按时间jobtbby31#
您需要根据
errorBucket
中的错误消息进行区分: