做一个vue模态弹出框如何

运用的知识点包括:

路由的配置

插槽

vue的过渡动画

路由重定向

 

 

 

 

router/index.js里面配置路由

import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/home'
import About from '@/components/about'

Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/about',
      name: 'About',
      component: About
    },
    { path: '/', redirect:'/home' }
    
  ]
})

 

 

app.vue 





 

 

home.vue






 

 

about.vue



 

 

modal.vue



 

转载于:https://www.cnblogs.com/lwj820876312/p/9100781.html

你可能感兴趣的:(做一个vue模态弹出框如何)