vue3.0、cli4項目引入element plus

element團隊為新版的 vue-cli4 準備了相應的 Element Plus 插件


安裝依賴

npm install element-plus --save

main.js全局引入,樣式文件需要單獨引入

import { createApp } from 'vue'
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import App from './App.vue';const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')

按需引入需要借助babel-plugin-import插件,詳情見官網




自定義樣式變量:

如果你的項目也使用了 SCSS,那么可以直接在項目中改變 Element Plus 的樣式變量,否則參考官網的其他方法。
在src中創建element-variables.scss

/* 所有變量在這里改后生效 */
/* 改變主題色變量 */
$--color-primary: teal;/* 改變 icon 字體路徑變量,必需 */
$--font-path: '~element-plus/lib/theme-chalk/fonts';@import "~element-plus/packages/theme-chalk/src/index";

main.js中引入

import Vue from 'vue'
import ElementPlus from 'element-plus'
import './element-variables.scss'
import App from './App.vue';const app = createApp(App)
app.use(ElementPlus)

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278634.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278634.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278634.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

MySQL索引背后的數據結構及算法原理

title: MySQL索引背后的數據結構及算法原理 date: 2018-07-25 19:50:16 tags: mysql categories: mysql --- 本文轉載自http://blog.codinglabs.org/articles/theory-of-mysql-index.html 摘要 本文以MySQL為研究對象,討論與數據庫索引相關的一些話題。特別需要說明…

[SDOI2015]約數個數和

Sol 首先有個結論\(\sum_{i1}^{m}\sum_{j1}^{n}d(i*j)\sum_{i1}^{m}\sum_{j1}^{n}\sum_{x|i}\sum_{y|i}[gcd(x,y)1]\) 證明:可以看po姐的博客 接著這個式子推\[ 原式\sum_{x1}^{n}\sum_{y1}^{m}([gcd(x, y)1] * \sum_{x|i}\sum_{y|i} 1)\\ \sum_{x1}^{n}\sum_{y1}^{…

使用mcBackup備份Windows 7 Media Center設置

If you’re a HTPC enthusiast and use Windows 7 Media Center, you probably have a lot of scheduled recordings and channel lineups you’d like to backup. Here we take a look at a simple tool that will allow you to do it easily. 如果您是HTPC愛好者并且使用Wind…

【CF961G】Partitions(第二類斯特林數)

【CF961G】Partitions(第二類斯特林數) 題面 CodeForces洛谷 題解 考慮每個數的貢獻,顯然每個數前面貢獻的系數都是一樣的。 枚舉當前數所在的集合大小,所以前面的系數\(p\)就是:\[\begin{aligned} p&\sum_{i1}^n{…

js綁定事件和阻止事件

js事件一、綁定事件1、html綁定2、el屬性綁定3、el函數綁定4、事件捕獲與冒泡5、js常見事件稱名二、阻止事件1、event.stopPropagation()2、return false3、event.preventDefault();4、兼容寫法一、綁定事件 1、html綁定 <div onclick"alert(click!)">click&…

linux中service的問題

1.描述問題 2.解決方案 systemctl stop firewalld systemctl mask firewalldThen, install the iptables-services package: yum install iptables-servicesEnable the service at boot-time: systemctl enable iptablesManaging the service systemctl [stop|start|restart] i…

火狐可以打開谷歌打不開_如何設置Firefox以使用Google Apps打開所有內容

火狐可以打開谷歌打不開Google offers a pretty comprehensive set of online applications which many of you probably take advantage of. Here is how to easily configure Firefox to use Google’s online offerings for email, RSS, PDF and office documents as your d…

設置第三方的SMTP服務

取得授權碼: 轉載于:https://www.cnblogs.com/0909/p/10153499.html

表單重復提交問題

2019獨角獸企業重金招聘Python工程師標準>>> 為什么會發生表單重復提交呢&#xff1f; 網絡延時 在平時開發中&#xff0c;如果網速比較慢的情況下&#xff0c;用戶提交表單后&#xff0c;發現服務器半天都沒有響應&#xff0c;那么用戶可能會以為是自己沒有提交表單…

js事件名稱集

一般事件 名稱描述onClick鼠標點擊事件&#xff0c;多用在某個對象控制的范圍內的鼠標點擊onDblClick鼠標雙擊事件onMouseDown鼠標上的按鈕被按下了onMouseUp鼠標按下后&#xff0c;松開時激發的事件onMouseOver當鼠標移動到某對象范圍的上方時觸發的事件onMouseMove鼠標移動時…

chrome 網頁重新加載_在Chrome中為各個網頁設置自定義重新加載時間

chrome 網頁重新加載Do you have a webpage that needs to be reloaded every so often or perhaps you have multiple webpages that each need their own individual reload time? Now you can have the best of both with the AutoReloader extension for Google Chrome. 您…

VMware Tools安裝和卸載

1、卸載 a.查找 vmware-uninstall-tools.pl 路徑&#xff1a;sudo find / -name vmware-uninstall-tools.pl b.切換到 vmware-unistall-tools.pl 目錄&#xff1a;cd /usr/bin/ c.卸載&#xff1a;sudo perl vmware-uninstall-tools.pl 2、安裝 a.掛載&#xff1a;sudo mount /…

MySQL解決方案

主從復制與主主復制怎么自動切換&#xff1a;使用Keepalived 日常如何導出數據&#xff1a;mysqldump、xtrabackup 主庫宕機解決方案&#xff08;一主多從&#xff09; 登陸從庫>show processlist\G; #cat /data/3306/data/master.info #cat /data/3307/data/master.ii…

iphone解鎖_有人可以用解鎖的iPhone做的最糟糕的事情是什么?

iphone解鎖Dedi Grigoroiu/Shutterstock.comDedi Grigoroiu / Shutterstock.comWe use our phones for event tickets, reservations, insurance cards, and even driver’s licenses. But what happens when someone takes your unlocked iPhone out of view for a moment—wh…

Alamofire源碼導讀二:發起請求及內部加鎖的邏輯

以創建一個 DataRequest 為例子 &#xfffc; 發起請求 創建 SessionManager 順帶也創建了一個 SessionDelegate 持有一個urlSession&#xff0c;持有一個串行的 DispatchQueue A。注意&#xff0c;這個不是urlSession 回調方法執行時所在的OperationQueue 創建 Requestable 的…

python os.path模塊

os.path.abspath(path) #返回絕對路徑os.path.basename(path) #返回文件名os.path.commonprefix(list) #返回list(多個路徑)中&#xff0c;所有path共有的最長的路徑。os.path.dirname(path) #返回文件路徑os.path.exists(path) #路徑存在則返回True,路徑損壞返回Falseos.path…

讓動畫每次重復前都有延遲

動畫不從0%開始即可 keyframes textmove {20% {transform: translateX(0);}100% {transform: translateX(-100%);} }

bixby映射軟件下載_如何在Samsung Galaxy S8,S9,S10,Note 8或Note 9上重新映射Bixby按鈕...

bixby映射軟件下載We’ve said before, and we’ll say it again: Bixby sucks. You’re better off using Google Assistant any day of the week. The good news is, it’s now possible to remap the pointless Bixby button without using a third-party app. 我們之前已經…

JavaScript數據結構和算法

前言 在過去的幾年中&#xff0c;得益于Node.js的興起&#xff0c;JavaScript越來越廣泛地用于服務器端編程。鑒于JavaScript語言已經走出了瀏覽器&#xff0c;程序員發現他們需要更多傳統語言&#xff08;比如C和Java&#xff09;提供的工具。這些工具包括傳統的數據結構&…

選擇器

// 什么是 HTML 以及怎樣使用 HTML 編寫網頁 // 網頁的結構是怎樣 // 什么是 CSS 以及怎樣使用 CSS // 如何在網頁中引入 JavaScript 代碼 // 什么是 DOM, 常用 DOM API 使用 // document object model // application program interface // 什么是事件, 如何綁定事件 // // 應…