im using laravel 5.4 and vue 2, and I want to load the async component with a button, and my vue js components are sepurate, for example: example.vue and test.vue, and I load them as an html tag
this is my app.js:
import './bootstrap';
import example from './components/Example.vue';
Vue.component('example', example);
const app = new Vue({
el: '#app'
});
and this place to display components
<How can i use Async components?div id="app">
<example2></example2>
</div>
How can I use Async components? thank
No I think you don't understand me
his registration of my component
import './bootstrap';
import example from './components/Example.vue';
Vue.component('example', example);
Vue.component('example2', function (resolve) {
require(['./components/Example2.vue'],resolve)
})
const app = new Vue({
el: '#app'
});
and in the request, it is enabled by default (shown) I don’t know how to pass the solution to me and reject the keys to this method on my page when I call the component
source
share