vue protect form
Protects users from leaving a form with changes by showing a dialog.
Install
You can install it via NPM
npm install @thijsvdanker/vue-protect-form --save
Usage
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>
Documentation
For documentation about properties and usage checkout the docs
Contributing
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.