Tutorial by Examples

Dynamically switch beetween multiple components using <component> element and pass data to v-bind:is attribute: Javascript: new Vue({ el: '#app', data: { currentPage: 'home' }, components: { home: { template: "<p>Home</p>" }, about...
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; ...

Page 1 of 1