Element常用组件之 表单组件 form

Element常用组件之 表单组件 form_第1张图片

 

1. 建立form.vue





2. 改一下路由 router->index.js

import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  
]

const router = new VueRouter({
  routes:[
    // 学习vuex, 多定义一个路由
    {
      path:'/',
      component:() => import('../views/Parent.vue'),
      // 重定向
      redirect:'/form'
    },
    {
      path:'/home/:id',
      // 动态路由传参,根据name指定,需要多配置一个name
      name:'home',
      component:() => import('../views/Home.vue'),
      Children:[{
        path:'/child',
        component:() => import('../views/Child.vue')
      }]
    },
    {
      // elementUI 之 layout
      path:'/layout',
      component:() => import('../views/elements/layout.vue')
    },
    {
      // elementUI 之 pop
      path:'/pop',
      component:() => import('../views/elements/pop.vue')
    },
    {
      // elementUI 之 pop
      path:'/table',
      component:() => import('../views/elements/table.vue')
    },
    {
      // elementUI 之 pop
      path:'/form',
      component:() => import('../views/elements/form.vue')
    },
  ]
})

export default router


你可能感兴趣的:(javascript)