vue 引入圖示庫
1.開啟阿里相簿,建立一個專案,再去尋找自己想要的圖示,最後下載至電腦。
2.開啟下載的檔案包,如下圖
3.將裡面的部分檔案拷貝至你的專案中,在static 目錄下建立一個資料夾fonts,如下圖
4.開啟iconfont.css,往裡面新增程式碼如下,
[class^="icon"], [class*=" icon"]/*這裡有空格*/
{ font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; }
整體為下圖
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1530695918383'); /* IE9*/
src: url('iconfont.eot?t=1530695918383#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAeoAAsAAAAAC7QAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZW7khyY21hcAAAAYAAAACIAAAB9GhgNsZnbHlmAAACCAAAA3kAAATo5JW55mhlYWQAAAWEAAAALwAAADYR5KfZaGhlYQAABbQAAAAcAAAAJAfeA4lobXR4AAAF0AAAABQAAAAgH+kAAGxvY2EAAAXkAAAAEgAAABIFMgOabWF4cAAABfgAAAAfAAAAIAEjAJBuYW1lAAAGGAAAAUUAAAJtPlT+fXBvc3QAAAdgAAAASAAAAF8h0nZgeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2Bk/ss4gYGVgYOpk+kMAwNDP4RmfM1gxMjBwMDEwMrMgBUEpLmmMDgwVDxrZm7438AQw9zA0AAUZgTJAQAutAz0eJzFkTEOg0AMBNeYAxSlyEPyET6RKo+go6Cj4pX7DbI+IyVI6VlrTvLqfD7ZAAoAF0/RArbBEFrlWvUdt+q3eCl/KOL+RGfhwJEzl33/6/zKauU3wnF06t/r5UZph8tk17U+617P95H1YjrQF+lJzJ8l0QTBIYldckyilnMSe+WSoPkAf8skqHic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Iahs273WreLJ+UZWtFnaLY5QyP5GWKfxzvREd5vt6MbU2vUbuOHu9FP6+t4sDGYxl9kb8H0AjNcmN641v3s3+HTw2cKx4ftVjRptfHtaIL+BGy78GsAAAB4nGNgZGBgAOIS3Scn4/ltvjJwszCAwPWkje8Q9P89LAzMLkAuBwMTSBQAUngLvwB4nGNgZGBgbvjfwBDDwgACQJKRARVwAABHDgJxeJxjYWBgYH7JwMDCgB0DABrXAQkAAAAAAHYAyADeASoBagGoAnQAAHicY2BkYGDgYGhhEGQAASYg5gJCBob/YD4DABeNAbQAeJxlj01OwzAQhV/6B6QSqqhgh+QFYgEo/RGrblhUavdddN+mTpsqiSPHrdQDcB6OwAk4AtyAO/BIJ5s2lsffvHljTwDc4Acejt8t95E9XDI7cg0XuBeuU38QbpBfhJto41W4Rf1N2MczpsJtdGF5g9e4YvaEd2EPHXwI13CNT+E69S/hBvlbuIk7/Aq30PHqwj7mXle4jUcv9sdWL5xeqeVBxaHJIpM5v4KZXu+Sha3S6pxrW8QmU4OgX0lTnWlb3VPs10PnIhVZk6oJqzpJjMqt2erQBRvn8lGvF4kehCblWGP+tsYCjnEFhSUOjDFCGGSIyujoO1Vm9K+xQ8Jee1Y9zed0WxTU/3OFAQL0z1xTurLSeTpPgT1fG1J1dCtuy56UNJFezUkSskJe1rZUQuoBNmVXjhF6XNGJPyhnSP8ACVpuyAAAAHicbcFBDoAgDATALgKCvyx1NSSEQ6OJz/fg1RkJ8tnkX0HAgoiEjBUFVfBEdWp12qXzHMx+t0bP1t0G4+iT6VDjLvICXRUOwQ==') format('woff'),
url('iconfont.ttf?t=1530695918383') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('iconfont.svg?t=1530695918383#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family:"iconfont" !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
[class^="icon"], [class*=" icon"]/*這裡有空格*/
{ font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; }
.icon-area:before { content: "\e683"; }
.icon-rectangle:before { content: "\e603"; }
.icon-rubber:before { content: "\e67f"; }
.icon-circle:before { content: "\e608"; }
.icon-line:before { content: "\e605"; }
.icon-faced:before { content: "\e649"; }
5.在專案中運用
在main.js中引入
import 'static/fonts/iconfont.css'
html裡面這樣使用它
<i class="ico icon-rubber">這樣我們就可以自定義自己想要的各種圖示了
相關文章
- Vue引入icon圖示Vue
- 本地引入vue、element-ui引入fonts,icon圖示不生效問題VueUI
- vue 專案引入字型圖示報錯、不顯示等問題Vue
- vue引入cesimu地圖Vue地圖
- Css字型圖示引入方式CSS
- Element Plus按需引入圖示
- font-class引入css樣式,引入字型圖示CSS
- Css字型圖示偽元素方式引入CSS
- vue專案中使用unicode引入iconfont,動態生成圖示的問題。VueUnicode
- Vue中引入TradingView製作K線圖VueView
- 微信小程式引入圖示字型Font Awesome微信小程式
- vue更換圖示Vue
- MUI框架-14-使用自定義icon圖示、引入阿里巴巴向量圖示UI框架阿里
- vue 滑鼠移入顯示圖示 ,滑鼠移出隱藏圖示Vue
- vue載入第三方圖示庫(轉載)Vue
- Vue中引入jQuery兩種方式可在vue中引入jQueryVuejQuery
- 阿里圖示向量庫阿里
- 阿里圖示庫使用阿里
- vue中引入echartsVueEcharts
- vue-2 引入echarts畫中國地圖底部地圖填充不顯示, 只出現了南海諸島部分VueEcharts地圖
- iconfont圖示庫的使用
- Vue + Spring Boot 專案實戰(四):資料庫的引入VueSpring Boot資料庫
- vue專案引入jqueryVuejQuery
- vue引入element-uiVueUI
- vue el-image 顯示圖片Vue
- Symbol 引用 iconfont icon圖示庫Symbol
- 前端使用阿里雲圖示庫前端阿里
- 短視訊開發app,vue v-viewer庫 顯示出圖片名稱APPVueView
- 在vue下引入jquery bootstrapVuejQueryboot
- Vue專案搭建 + 引入ElementUIVueUI
- 1.引入vue.jsVue.js
- Vue Cli 4 引入 Cesium 配置Vue
- @vue/cli3.0 使用任意 SVG 圖示VueSVG
- wpf 中阿里圖示庫的使用阿里
- vue 專案中ivew按需引入Vue
- vue迴圈顯示base64圖片Vue
- QT creator中cmake管理專案,如何引入外部庫(引入Eigen庫為例)QT
- Ionicons圖示庫: 讓網頁栩栩生輝,Ionic Framework的經典之作,圖示庫新標杆!網頁Framework