Closed youtingkun closed 3 years ago
main.js
import Loading from 'vue-loading-overlay'; Vue.use(Loading);
example.vue
<template> <form @submit.prevent="submit" class="vld-parent" ref="formContainer"> <!-- your form inputs goes here--> <label><input type="checkbox" v-model="fullPage" />Full page?</label> <button type="submit">Login</button> </form> </template> <script> export default { data() { return { fullPage: false, }; }, methods: { submit() { let loader = this.$loading.show({ // Optional parameters container: this.fullPage ? null : this.$refs.formContainer, canCancel: true, onCancel: this.onCancel, }); // simulate AJAX setTimeout(() => { loader.hide(); }, 5000); }, onCancel() { console.log('User cancelled the loader.'); }, }, }; </script>
error:
vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in v-on handler: "TypeError: this.$loading.show is not a function"
Please fill the issue template and specifytthe versions.
main.js
example.vue
error: