0๐
I solve this problem by replacing the <form></form>
with <div></div>
. It seems if use <form></form>
tag, the page reloading is inevitable.
- [Vuejs]-Why when i am sending blob in fetch i can download file but when i am using axios it will not work?
- [Vuejs]-Vue js modal won't adjust below width of element it contains
0๐
@submit.prevent="register"
try this maybe work.
<template>
<XAIHeader :registerActive="true"></XAIHeader>
<div class="container">
<form @submit.prevent="register" class="w-50 mx-auto pt-5" style="padding-bottom: 400px;">
<h5 class="mb-3">register</h5>
<div>
<label class="form-label">user name</label>
<input v-model="usrName" type="text" class="form-control" required>
</div>
<div>
<label class="form-label">pass word </label>
<input v-model="pass1" type="current-password" class="form-control" required>
</div>
<div>
<label class="form-label">repeat pass word</label>
<input v-model="pass2" type="new-password" class="form-control" required>
</div>
<div class="mt-3">
<button class="btn btn-primary" type="submit">register</button>
</div>
</form>
{{ this.$store.state.sysDecision.usrDecision}}
</div>
</template>
reference here
https://vuejs.org/guide/essentials/event-handling.html#event-modifiers
- [Vuejs]-Vuejs post does not find NodeJs Express server/action
- [Vuejs]-Iframe invoked with Youtube API does not appear after Vue.js V-if command
-1๐
After submit response the form data you need to make your v-model data to null, then your form will be reset.
this.usrName = null
Source:stackexchange.com