动态组件
http://cn.vuejs.org/guide/components.html#动态组件

多个组件可以使用同一个挂载点,然后动态地在它们之间切换。使用保留的 元素,动态地绑定到它的 is 特性:

new Vue({
  el: 'body',
  data: {
    currentView: 'home'
  },
  components: {
    home: { /* ... */ },
    posts: { /* ... */ },
    archive: { /* ... */ }
  }
})
<component :is="currentView">
  <!-- 组件在 vm.currentview 变化时改变 -->
</component>

相关文章:

  • 2021-08-14
  • 2021-09-09
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-12-04
  • 2021-12-07
猜你喜欢
  • 2021-05-25
  • 2021-07-14
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案