前端VUE项目使用elementUi基础搭建
方便后续搭建前端项目快速搭建
main.js文件
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import router from './router'
Vue.use(router)
Vue.config.productionTip = false
Vue.use(ElementUI)
/* eslint-disable no-new */
new Vue({
el: '#app',
components: { App },
router,
template: '<App/>',
render: h => h(App)
})
App.vue
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
router的index
import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/login'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/login',
component: Login
}
]
})
登录页面login
<template>
<el-input type="text"></el-input>
</template>
<script>
export default {
name: 'login'
}
</script>
<style scoped>