其他分享
首页 > 其他分享> > 12、vue+elementUI (链接版)

12、vue+elementUI (链接版)

作者:互联网

链接:https://blog.csdn.net/qq_42025798/article/details/122369907?ops_request_misc=&request_id=&biz_id=102&utm_term=vue最新上手&utm_medium=distribute.pc_search_result.none-task-blog-2

import Vue from 'vue'
import Router from 'vue-router'
import Main from "../views/Main";
import Login from "../views/Login";

Vue.use(Router);

export default new Router({
  routes:[
    {
      path: '/main',
      name:'main',
      component: Main,
    },
    {
      path: "/login",
      name: 'login',
      component: Login
    }


  ]

});


import Vue from 'vue'
import App from './App'
// 扫描路由
import router from './router'
//导入element-ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(router);
Vue.use(ElementUI);

new Vue({
  el: '#app',
  // 安装路由
  router,
  render: h => h(App), //elementUi

})
<template>
  <div id="app">
<router-view></router-view>
  </div>
</template>

<script>


export default {
  name: 'App',

}
</script>

标签:vue,elementUI,App,Vue,12,router,import,路由
来源: https://www.cnblogs.com/ahhh7931/p/16701768.html