vue-cli3.0安裝element-ui組件及按需引入element-ui組件

在之前最好是備份APP.JS里面的東西 因為不知道為什么會改變APP.JS里面的東西

1,在 命令行輸入? ?vue add element


2,How do you want to import Element? -->選擇 Import on demand (關(guān)鍵)按需引入

? 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了 大功告成了?

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 這兩周算是漸漸步入正軌,漸漸地有了一些權(quán)限,加入了客戶溝通群,開通了svn等等,一步步融入了這個部門,也熟悉了這樣...
    youngcheer閱讀 127評論 0 0
  • 感冒好嚴重,明天能挺嗎?以為自己很強壯,沒想到說病就病了,以后還得愛惜自己。 發(fā)現(xiàn)跟孩子跳了下街舞精神很陽光了,看...
    未遲_a734閱讀 137評論 0 0
  • 新年的第一輪紅日 就要從東方冉冉升起 冬風又將 送來新的希望 我們捧著希望在手心 唯恐撒落 愿情侶們的心緊貼著 只...
    冷冬年閱讀 277評論 1 2

友情鏈接更多精彩內(nèi)容