我有this.userGroups
[ {“id”:46,“group_id”:38,“url”:“1”,“url_num”:1,“max_iteration”:2},{“id”:45,“group_id”:38,“url “:”2,“url_num”:1,“max_iteration”:2},{“id”:44,“group_id”:38,“url”:“3”,“url_num”:1,“max_iteration”: 2},{“id”:43,“group_id”:38,“url”:“4”,“url_num”:1,“max_iteration”:2}]
<v-row v-for="(urlGroup, index) in urlGroups" :key="index">
<v-col cols="12" sm="6" md="3">
<v-text-field required v-model="urlGroup.url" label="URL" clear-icon="mdi-close-circle" clearable type="text" @click:clear="removeUrl(index)"></v-text-field>
</v-col>
</v-row>
required
似乎不起作用,因为我仍然可以在不提供任何价值的情况下提交表单。我曾经在单个文本字段中执行此操作,但现在它是动态的,我不知道该怎么做。
url: [(v) => !!v || 'URL is required']
如何将验证规则添加到所有要键入的 URL 和必需的?