Vue router-view and transition

used in layout,like head,body,foot,and body will be replaced by different content

config the component in router.ts.add children element.

router.ts

import LayoutPopup from '@/components/layout/index_popup.vue'
{
      path : '/xx/auth/' ,
      component : LayoutPopup ,
      children : [
        {
          path : 'xxxx1111' ,
          name : 'xxxx1111' ,
          meta : { title : 'xxxxx' } ,
          component : () => import( '@/views/xxx/xxxx1111/xxxx1111.vue' )  
        }
}
----------------------
index_popup.vue
< template >
  <div class = "dc-wrapper" >
    < Header ></ Header >
    <div class = "dc-main-container" >
      <div class = "dc-column -main" >
        < AppMain / >
      </div>
    </div>
    < Footer ></ Footer >
  </div>
</ template >
import AppMain from './main/app-main.vue'
-----------------------------
app-main.vue
< template >
  <transition>
    <router-view / >
  </transition>
</ template >
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章