I'm using laravel and vuejs2 and as you know we can load components using dynamic components and current view var
and now I loaded a component using this method and now I want load another component from this component which I loaded (this component will remove and another will replace with it)
how can I do that?
import example from './components/Example.vue';
import example2 from './components/Example2.vue';
import login from './components/Login.vue';
Vue.component('example', example);
Vue.component('example2', example2);
Vue.component('login', login);
const app = new Vue({
el: '#content',
data: {
currentView: '',
show: true
},
methods:{
example1: function(){ this.currentView = 'login'; },
example2: function(){ this.currentView = 'example2'; },
noview: function(){ this.currentView = ''; }
}
});
and
<component :is='currentView'> </component>