Sometimes you want to keep the switched-out components in memory, to make that happen, you should use <keep-alive> element:
Javascript:
new Vue({
el: '#app',
data: {
currentPage: 'home',
},
methods: {
switchTo: function(page) {
this.currentPage = page;
...