Answer the question
In order to leave comments, you need to log in
Why doesn't it switch to another component?
<div class="box_profile">
<div class="box_left">
<a href="#">Settings</a>
<a href="#" @click="switchActive('users')">Users</a>
<a href="#" @click="switchActive('history')" class="active">History</a> </div>
<div class="box_right">
<components :is="users"> </components>
<script>
import users from "~/components/users.vue"
import history from "~/components/history.vue"
components: {
users,
history
},
data() {
return {
active: 'users',
}
},
methods: {
switchActive: function(view) {
this.active = view;
console.log("ok")
}
},
}
</script>
throws an error Answer the question
In order to leave comments, you need to log in
probably a typo here
<components :is="users"> </components>
<components :is="active"> </components>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question