数秒 read (About 41 words)
VuetifyのバリデーションをJavaScriptで実行する
html
1 2 3 4 5
| <v-form ref="form"> <v-text-field :rules="[rules.required]" ></v-text-field> </v-form>
|
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13
| let form = ref(null) const rules = ref({ required: value => !!value || '', })
const submit = async () => { const validResult = await form.value.validate() if (!validResult.valid) { return } }
|