Protects users from leaving a form with changes by showing a dialog.
You can install it via NPM
npm install @thijsvdanker/vue-protect-form --save
Include plugin in your main.js
file.
import VueProtectForm from 'vue-protect-form'
Vue.use(VueProtectForm)
To protect a form, wrap the form with a <vue-protect-form>
tag.
Example:
<vue-protect-form>
<form method="POST" action="/">
<input type="text" name="foo">
</form>
</vue-protect-form>
For documentation about properties and usage checkout the docs
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.