在之前最好是備份APP.JS里面的東西 因為不知道為什么會改變APP.JS里面的東西
1,在 命令行輸入? ?vue add element
2,How do you want to import Element? -->選擇 Import on demand (關鍵)按需引入
? Fully import? 全局引入
Choose the locale you want to load–>選擇 zh-CN
3, 會自動 寫入不用管
src/plugins/element.js
? ? babel.config.js
? ? jsons.json
? ? package-lock.json
? ? package.json
? ? src/App.vue
? ? src/main.js
4菠发,不知道為什么會改變APP.JS里面的東西
會變成下面這樣不知道為什么
<div id="app">
? ? <img src="./assets/logo.png">
? ? ? ? If Element is successfully added to this project, you'll see an
<code v-text="''">
? ? ? ? below
? ? ? <el-button>el-button
? ? <HelloWorld msg="Welcome to Your Vue.js App"/>
import HelloWorldfrom './components/HelloWorld.vue'
export default {
name:'app',
? components: {
HelloWorld
}
}
#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;
}
我項目正確的
? <div id="app">
<style lang="less">
? html,body,#app{
margin:0;
? ? padding:0;
? ? width:100%;
? ? height:100%;
? }
#app {
min-width:1200px;
? ? font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微軟雅黑",Arial,sans-serif;
? }
.ct{
width:1200px;
? ? margin:0 auto;
? }
5,OK了 大功告成了?