<component>加上 "is":動態組件用法(可以切換多個模板的組件)

在我們平時使用vue中的模板的時候,許多時候都是直接定義成一個固定的模板,但是,vue中提供了一個動態模板,可以在任意模板中切換,就是用vue中<component>用:is來掛載不同的組件。 <div id="app" v-cloak> <component :is="currentView"></component> <button @click="handle
相關文章
相關標籤/搜索