Untitled
unknown
plain_text
a year ago
619 B
8
Indexable
<script setup>
import { reactive, computed, onMounted } from "vue";
import { useRouter } from "vue-router";
import { required, email } from "@vuelidate/validators";
import { useVuelidate } from "@vuelidate/core";
const router = useRouter();
const state = reactive({
email: "",
password: "",
});
const stateRules = computed(() => {
return {
email: { required, email },
password: { required },
};
});
const v$ = useVuelidate(stateRules, state);
const login = onMounted(() => {
this.v$.$validate();
if (this.v$ === state) {
alert("successful");
} else {
alert("wrong");
}
});
</script>Editor is loading...
Leave a Comment