demo_index.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>iconfont Demo</title>
  6. <link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
  7. <link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
  8. <link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
  9. <link rel="stylesheet" href="demo.css">
  10. <link rel="stylesheet" href="iconfont.css">
  11. <script src="iconfont.js"></script>
  12. <!-- jQuery -->
  13. <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
  14. <!-- 代码高亮 -->
  15. <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
  16. <style>
  17. .main .logo {
  18. margin-top: 0;
  19. height: auto;
  20. }
  21. .main .logo a {
  22. display: flex;
  23. align-items: center;
  24. }
  25. .main .logo .sub-title {
  26. margin-left: 0.5em;
  27. font-size: 22px;
  28. color: #fff;
  29. background: linear-gradient(-45deg, #3967FF, #B500FE);
  30. -webkit-background-clip: text;
  31. -webkit-text-fill-color: transparent;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div class="main">
  37. <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
  38. <img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
  39. </a></h1>
  40. <div class="nav-tabs">
  41. <ul id="tabs" class="dib-box">
  42. <li class="dib active"><span>Unicode</span></li>
  43. <li class="dib"><span>Font class</span></li>
  44. <li class="dib"><span>Symbol</span></li>
  45. </ul>
  46. <a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=4491859" target="_blank" class="nav-more">查看项目</a>
  47. </div>
  48. <div class="tab-container">
  49. <div class="content unicode" style="display: block;">
  50. <ul class="icon_lists dib-box">
  51. <li class="dib">
  52. <span class="icon iconfont">&#xe660;</span>
  53. <div class="name">待装箱</div>
  54. <div class="code-name">&amp;#xe660;</div>
  55. </li>
  56. <li class="dib">
  57. <span class="icon iconfont">&#xe662;</span>
  58. <div class="name">已装箱</div>
  59. <div class="code-name">&amp;#xe662;</div>
  60. </li>
  61. <li class="dib">
  62. <span class="icon iconfont">&#xe71b;</span>
  63. <div class="name">扫码装车</div>
  64. <div class="code-name">&amp;#xe71b;</div>
  65. </li>
  66. <li class="dib">
  67. <span class="icon iconfont">&#xe607;</span>
  68. <div class="name">合并装箱</div>
  69. <div class="code-name">&amp;#xe607;</div>
  70. </li>
  71. <li class="dib">
  72. <span class="icon iconfont">&#xe685;</span>
  73. <div class="name">外接探头</div>
  74. <div class="code-name">&amp;#xe685;</div>
  75. </li>
  76. <li class="dib">
  77. <span class="icon iconfont">&#xe606;</span>
  78. <div class="name">logout</div>
  79. <div class="code-name">&amp;#xe606;</div>
  80. </li>
  81. <li class="dib">
  82. <span class="icon iconfont">&#xe7a9;</span>
  83. <div class="name">卸货</div>
  84. <div class="code-name">&amp;#xe7a9;</div>
  85. </li>
  86. <li class="dib">
  87. <span class="icon iconfont">&#xe6c0;</span>
  88. <div class="name">未发货</div>
  89. <div class="code-name">&amp;#xe6c0;</div>
  90. </li>
  91. <li class="dib">
  92. <span class="icon iconfont">&#xe626;</span>
  93. <div class="name">物流详情-已发货</div>
  94. <div class="code-name">&amp;#xe626;</div>
  95. </li>
  96. <li class="dib">
  97. <span class="icon iconfont">&#xe605;</span>
  98. <div class="name">签收_fill</div>
  99. <div class="code-name">&amp;#xe605;</div>
  100. </li>
  101. <li class="dib">
  102. <span class="icon iconfont">&#xe613;</span>
  103. <div class="name">已装车</div>
  104. <div class="code-name">&amp;#xe613;</div>
  105. </li>
  106. <li class="dib">
  107. <span class="icon iconfont">&#xe63b;</span>
  108. <div class="name">卸货费</div>
  109. <div class="code-name">&amp;#xe63b;</div>
  110. </li>
  111. <li class="dib">
  112. <span class="icon iconfont">&#xe749;</span>
  113. <div class="name">全部订单</div>
  114. <div class="code-name">&amp;#xe749;</div>
  115. </li>
  116. <li class="dib">
  117. <span class="icon iconfont">&#xe639;</span>
  118. <div class="name">已到达</div>
  119. <div class="code-name">&amp;#xe639;</div>
  120. </li>
  121. <li class="dib">
  122. <span class="icon iconfont">&#xe619;</span>
  123. <div class="name">出库单</div>
  124. <div class="code-name">&amp;#xe619;</div>
  125. </li>
  126. <li class="dib">
  127. <span class="icon iconfont">&#xe772;</span>
  128. <div class="name">返库登记</div>
  129. <div class="code-name">&amp;#xe772;</div>
  130. </li>
  131. <li class="dib">
  132. <span class="icon iconfont">&#xe68d;</span>
  133. <div class="name">添加订单</div>
  134. <div class="code-name">&amp;#xe68d;</div>
  135. </li>
  136. <li class="dib">
  137. <span class="icon iconfont">&#xe612;</span>
  138. <div class="name">车辆信息</div>
  139. <div class="code-name">&amp;#xe612;</div>
  140. </li>
  141. <li class="dib">
  142. <span class="icon iconfont">&#xe60e;</span>
  143. <div class="name">我的</div>
  144. <div class="code-name">&amp;#xe60e;</div>
  145. </li>
  146. <li class="dib">
  147. <span class="icon iconfont">&#xe609;</span>
  148. <div class="name">首页</div>
  149. <div class="code-name">&amp;#xe609;</div>
  150. </li>
  151. <li class="dib">
  152. <span class="icon iconfont">&#xe66f;</span>
  153. <div class="name">扫一扫</div>
  154. <div class="code-name">&amp;#xe66f;</div>
  155. </li>
  156. <li class="dib">
  157. <span class="icon iconfont">&#xe67a;</span>
  158. <div class="name">未入库</div>
  159. <div class="code-name">&amp;#xe67a;</div>
  160. </li>
  161. <li class="dib">
  162. <span class="icon iconfont">&#xe6dc;</span>
  163. <div class="name">核销订单</div>
  164. <div class="code-name">&amp;#xe6dc;</div>
  165. </li>
  166. <li class="dib">
  167. <span class="icon iconfont">&#xe821;</span>
  168. <div class="name">未入库_点击态</div>
  169. <div class="code-name">&amp;#xe821;</div>
  170. </li>
  171. <li class="dib">
  172. <span class="icon iconfont">&#xe624;</span>
  173. <div class="name">冷链库</div>
  174. <div class="code-name">&amp;#xe624;</div>
  175. </li>
  176. </ul>
  177. <div class="article markdown">
  178. <h2 id="unicode-">Unicode 引用</h2>
  179. <hr>
  180. <p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
  181. <ul>
  182. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  183. <li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
  184. </ul>
  185. <blockquote>
  186. <p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
  187. </blockquote>
  188. <p>Unicode 使用步骤如下:</p>
  189. <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
  190. <pre><code class="language-css"
  191. >@font-face {
  192. font-family: 'iconfont';
  193. src: url('iconfont.woff2?t=1724056907926') format('woff2'),
  194. url('iconfont.woff?t=1724056907926') format('woff'),
  195. url('iconfont.ttf?t=1724056907926') format('truetype');
  196. }
  197. </code></pre>
  198. <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
  199. <pre><code class="language-css"
  200. >.iconfont {
  201. font-family: "iconfont" !important;
  202. font-size: 16px;
  203. font-style: normal;
  204. -webkit-font-smoothing: antialiased;
  205. -moz-osx-font-smoothing: grayscale;
  206. }
  207. </code></pre>
  208. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  209. <pre>
  210. <code class="language-html"
  211. >&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
  212. </code></pre>
  213. <blockquote>
  214. <p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  215. </blockquote>
  216. </div>
  217. </div>
  218. <div class="content font-class">
  219. <ul class="icon_lists dib-box">
  220. <li class="dib">
  221. <span class="icon iconfont icon-bepacked"></span>
  222. <div class="name">
  223. 待装箱
  224. </div>
  225. <div class="code-name">.icon-bepacked
  226. </div>
  227. </li>
  228. <li class="dib">
  229. <span class="icon iconfont icon-boxed"></span>
  230. <div class="name">
  231. 已装箱
  232. </div>
  233. <div class="code-name">.icon-boxed
  234. </div>
  235. </li>
  236. <li class="dib">
  237. <span class="icon iconfont icon-truck"></span>
  238. <div class="name">
  239. 扫码装车
  240. </div>
  241. <div class="code-name">.icon-truck
  242. </div>
  243. </li>
  244. <li class="dib">
  245. <span class="icon iconfont icon-encasement"></span>
  246. <div class="name">
  247. 合并装箱
  248. </div>
  249. <div class="code-name">.icon-encasement
  250. </div>
  251. </li>
  252. <li class="dib">
  253. <span class="icon iconfont icon-waijietantou"></span>
  254. <div class="name">
  255. 外接探头
  256. </div>
  257. <div class="code-name">.icon-waijietantou
  258. </div>
  259. </li>
  260. <li class="dib">
  261. <span class="icon iconfont icon-tuichudenglu"></span>
  262. <div class="name">
  263. logout
  264. </div>
  265. <div class="code-name">.icon-tuichudenglu
  266. </div>
  267. </li>
  268. <li class="dib">
  269. <span class="icon iconfont icon-xiehuo"></span>
  270. <div class="name">
  271. 卸货
  272. </div>
  273. <div class="code-name">.icon-xiehuo
  274. </div>
  275. </li>
  276. <li class="dib">
  277. <span class="icon iconfont icon-weifahuo"></span>
  278. <div class="name">
  279. 未发货
  280. </div>
  281. <div class="code-name">.icon-weifahuo
  282. </div>
  283. </li>
  284. <li class="dib">
  285. <span class="icon iconfont icon-yifahuo"></span>
  286. <div class="name">
  287. 物流详情-已发货
  288. </div>
  289. <div class="code-name">.icon-yifahuo
  290. </div>
  291. </li>
  292. <li class="dib">
  293. <span class="icon iconfont icon-qianshou_fill"></span>
  294. <div class="name">
  295. 签收_fill
  296. </div>
  297. <div class="code-name">.icon-qianshou_fill
  298. </div>
  299. </li>
  300. <li class="dib">
  301. <span class="icon iconfont icon-yizhuangche"></span>
  302. <div class="name">
  303. 已装车
  304. </div>
  305. <div class="code-name">.icon-yizhuangche
  306. </div>
  307. </li>
  308. <li class="dib">
  309. <span class="icon iconfont icon-xiehuofei"></span>
  310. <div class="name">
  311. 卸货费
  312. </div>
  313. <div class="code-name">.icon-xiehuofei
  314. </div>
  315. </li>
  316. <li class="dib">
  317. <span class="icon iconfont icon-dingdan"></span>
  318. <div class="name">
  319. 全部订单
  320. </div>
  321. <div class="code-name">.icon-dingdan
  322. </div>
  323. </li>
  324. <li class="dib">
  325. <span class="icon iconfont icon-yidaoda"></span>
  326. <div class="name">
  327. 已到达
  328. </div>
  329. <div class="code-name">.icon-yidaoda
  330. </div>
  331. </li>
  332. <li class="dib">
  333. <span class="icon iconfont icon-chukudan"></span>
  334. <div class="name">
  335. 出库单
  336. </div>
  337. <div class="code-name">.icon-chukudan
  338. </div>
  339. </li>
  340. <li class="dib">
  341. <span class="icon iconfont icon-fankudengji"></span>
  342. <div class="name">
  343. 返库登记
  344. </div>
  345. <div class="code-name">.icon-fankudengji
  346. </div>
  347. </li>
  348. <li class="dib">
  349. <span class="icon iconfont icon-tianjiadingdan"></span>
  350. <div class="name">
  351. 添加订单
  352. </div>
  353. <div class="code-name">.icon-tianjiadingdan
  354. </div>
  355. </li>
  356. <li class="dib">
  357. <span class="icon iconfont icon-cheliangxinxi"></span>
  358. <div class="name">
  359. 车辆信息
  360. </div>
  361. <div class="code-name">.icon-cheliangxinxi
  362. </div>
  363. </li>
  364. <li class="dib">
  365. <span class="icon iconfont icon-wode"></span>
  366. <div class="name">
  367. 我的
  368. </div>
  369. <div class="code-name">.icon-wode
  370. </div>
  371. </li>
  372. <li class="dib">
  373. <span class="icon iconfont icon-shouye"></span>
  374. <div class="name">
  375. 首页
  376. </div>
  377. <div class="code-name">.icon-shouye
  378. </div>
  379. </li>
  380. <li class="dib">
  381. <span class="icon iconfont icon-saoyisao"></span>
  382. <div class="name">
  383. 扫一扫
  384. </div>
  385. <div class="code-name">.icon-saoyisao
  386. </div>
  387. </li>
  388. <li class="dib">
  389. <span class="icon iconfont icon-yiruku"></span>
  390. <div class="name">
  391. 未入库
  392. </div>
  393. <div class="code-name">.icon-yiruku
  394. </div>
  395. </li>
  396. <li class="dib">
  397. <span class="icon iconfont icon-qianshou"></span>
  398. <div class="name">
  399. 核销订单
  400. </div>
  401. <div class="code-name">.icon-qianshou
  402. </div>
  403. </li>
  404. <li class="dib">
  405. <span class="icon iconfont icon-weiruku"></span>
  406. <div class="name">
  407. 未入库_点击态
  408. </div>
  409. <div class="code-name">.icon-weiruku
  410. </div>
  411. </li>
  412. <li class="dib">
  413. <span class="icon iconfont icon-lenglianku"></span>
  414. <div class="name">
  415. 冷链库
  416. </div>
  417. <div class="code-name">.icon-lenglianku
  418. </div>
  419. </li>
  420. </ul>
  421. <div class="article markdown">
  422. <h2 id="font-class-">font-class 引用</h2>
  423. <hr>
  424. <p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
  425. <p>与 Unicode 使用方式相比,具有如下特点:</p>
  426. <ul>
  427. <li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
  428. <li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
  429. </ul>
  430. <p>使用步骤如下:</p>
  431. <h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
  432. <pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
  433. </code></pre>
  434. <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
  435. <pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
  436. </code></pre>
  437. <blockquote>
  438. <p>"
  439. iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  440. </blockquote>
  441. </div>
  442. </div>
  443. <div class="content symbol">
  444. <ul class="icon_lists dib-box">
  445. <li class="dib">
  446. <svg class="icon svg-icon" aria-hidden="true">
  447. <use xlink:href="#icon-bepacked"></use>
  448. </svg>
  449. <div class="name">待装箱</div>
  450. <div class="code-name">#icon-bepacked</div>
  451. </li>
  452. <li class="dib">
  453. <svg class="icon svg-icon" aria-hidden="true">
  454. <use xlink:href="#icon-boxed"></use>
  455. </svg>
  456. <div class="name">已装箱</div>
  457. <div class="code-name">#icon-boxed</div>
  458. </li>
  459. <li class="dib">
  460. <svg class="icon svg-icon" aria-hidden="true">
  461. <use xlink:href="#icon-truck"></use>
  462. </svg>
  463. <div class="name">扫码装车</div>
  464. <div class="code-name">#icon-truck</div>
  465. </li>
  466. <li class="dib">
  467. <svg class="icon svg-icon" aria-hidden="true">
  468. <use xlink:href="#icon-encasement"></use>
  469. </svg>
  470. <div class="name">合并装箱</div>
  471. <div class="code-name">#icon-encasement</div>
  472. </li>
  473. <li class="dib">
  474. <svg class="icon svg-icon" aria-hidden="true">
  475. <use xlink:href="#icon-waijietantou"></use>
  476. </svg>
  477. <div class="name">外接探头</div>
  478. <div class="code-name">#icon-waijietantou</div>
  479. </li>
  480. <li class="dib">
  481. <svg class="icon svg-icon" aria-hidden="true">
  482. <use xlink:href="#icon-tuichudenglu"></use>
  483. </svg>
  484. <div class="name">logout</div>
  485. <div class="code-name">#icon-tuichudenglu</div>
  486. </li>
  487. <li class="dib">
  488. <svg class="icon svg-icon" aria-hidden="true">
  489. <use xlink:href="#icon-xiehuo"></use>
  490. </svg>
  491. <div class="name">卸货</div>
  492. <div class="code-name">#icon-xiehuo</div>
  493. </li>
  494. <li class="dib">
  495. <svg class="icon svg-icon" aria-hidden="true">
  496. <use xlink:href="#icon-weifahuo"></use>
  497. </svg>
  498. <div class="name">未发货</div>
  499. <div class="code-name">#icon-weifahuo</div>
  500. </li>
  501. <li class="dib">
  502. <svg class="icon svg-icon" aria-hidden="true">
  503. <use xlink:href="#icon-yifahuo"></use>
  504. </svg>
  505. <div class="name">物流详情-已发货</div>
  506. <div class="code-name">#icon-yifahuo</div>
  507. </li>
  508. <li class="dib">
  509. <svg class="icon svg-icon" aria-hidden="true">
  510. <use xlink:href="#icon-qianshou_fill"></use>
  511. </svg>
  512. <div class="name">签收_fill</div>
  513. <div class="code-name">#icon-qianshou_fill</div>
  514. </li>
  515. <li class="dib">
  516. <svg class="icon svg-icon" aria-hidden="true">
  517. <use xlink:href="#icon-yizhuangche"></use>
  518. </svg>
  519. <div class="name">已装车</div>
  520. <div class="code-name">#icon-yizhuangche</div>
  521. </li>
  522. <li class="dib">
  523. <svg class="icon svg-icon" aria-hidden="true">
  524. <use xlink:href="#icon-xiehuofei"></use>
  525. </svg>
  526. <div class="name">卸货费</div>
  527. <div class="code-name">#icon-xiehuofei</div>
  528. </li>
  529. <li class="dib">
  530. <svg class="icon svg-icon" aria-hidden="true">
  531. <use xlink:href="#icon-dingdan"></use>
  532. </svg>
  533. <div class="name">全部订单</div>
  534. <div class="code-name">#icon-dingdan</div>
  535. </li>
  536. <li class="dib">
  537. <svg class="icon svg-icon" aria-hidden="true">
  538. <use xlink:href="#icon-yidaoda"></use>
  539. </svg>
  540. <div class="name">已到达</div>
  541. <div class="code-name">#icon-yidaoda</div>
  542. </li>
  543. <li class="dib">
  544. <svg class="icon svg-icon" aria-hidden="true">
  545. <use xlink:href="#icon-chukudan"></use>
  546. </svg>
  547. <div class="name">出库单</div>
  548. <div class="code-name">#icon-chukudan</div>
  549. </li>
  550. <li class="dib">
  551. <svg class="icon svg-icon" aria-hidden="true">
  552. <use xlink:href="#icon-fankudengji"></use>
  553. </svg>
  554. <div class="name">返库登记</div>
  555. <div class="code-name">#icon-fankudengji</div>
  556. </li>
  557. <li class="dib">
  558. <svg class="icon svg-icon" aria-hidden="true">
  559. <use xlink:href="#icon-tianjiadingdan"></use>
  560. </svg>
  561. <div class="name">添加订单</div>
  562. <div class="code-name">#icon-tianjiadingdan</div>
  563. </li>
  564. <li class="dib">
  565. <svg class="icon svg-icon" aria-hidden="true">
  566. <use xlink:href="#icon-cheliangxinxi"></use>
  567. </svg>
  568. <div class="name">车辆信息</div>
  569. <div class="code-name">#icon-cheliangxinxi</div>
  570. </li>
  571. <li class="dib">
  572. <svg class="icon svg-icon" aria-hidden="true">
  573. <use xlink:href="#icon-wode"></use>
  574. </svg>
  575. <div class="name">我的</div>
  576. <div class="code-name">#icon-wode</div>
  577. </li>
  578. <li class="dib">
  579. <svg class="icon svg-icon" aria-hidden="true">
  580. <use xlink:href="#icon-shouye"></use>
  581. </svg>
  582. <div class="name">首页</div>
  583. <div class="code-name">#icon-shouye</div>
  584. </li>
  585. <li class="dib">
  586. <svg class="icon svg-icon" aria-hidden="true">
  587. <use xlink:href="#icon-saoyisao"></use>
  588. </svg>
  589. <div class="name">扫一扫</div>
  590. <div class="code-name">#icon-saoyisao</div>
  591. </li>
  592. <li class="dib">
  593. <svg class="icon svg-icon" aria-hidden="true">
  594. <use xlink:href="#icon-yiruku"></use>
  595. </svg>
  596. <div class="name">未入库</div>
  597. <div class="code-name">#icon-yiruku</div>
  598. </li>
  599. <li class="dib">
  600. <svg class="icon svg-icon" aria-hidden="true">
  601. <use xlink:href="#icon-qianshou"></use>
  602. </svg>
  603. <div class="name">核销订单</div>
  604. <div class="code-name">#icon-qianshou</div>
  605. </li>
  606. <li class="dib">
  607. <svg class="icon svg-icon" aria-hidden="true">
  608. <use xlink:href="#icon-weiruku"></use>
  609. </svg>
  610. <div class="name">未入库_点击态</div>
  611. <div class="code-name">#icon-weiruku</div>
  612. </li>
  613. <li class="dib">
  614. <svg class="icon svg-icon" aria-hidden="true">
  615. <use xlink:href="#icon-lenglianku"></use>
  616. </svg>
  617. <div class="name">冷链库</div>
  618. <div class="code-name">#icon-lenglianku</div>
  619. </li>
  620. </ul>
  621. <div class="article markdown">
  622. <h2 id="symbol-">Symbol 引用</h2>
  623. <hr>
  624. <p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
  625. 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
  626. <ul>
  627. <li>支持多色图标了,不再受单色限制。</li>
  628. <li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
  629. <li>兼容性较差,支持 IE9+,及现代浏览器。</li>
  630. <li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
  631. </ul>
  632. <p>使用步骤如下:</p>
  633. <h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
  634. <pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
  635. </code></pre>
  636. <h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
  637. <pre><code class="language-html">&lt;style&gt;
  638. .icon {
  639. width: 1em;
  640. height: 1em;
  641. vertical-align: -0.15em;
  642. fill: currentColor;
  643. overflow: hidden;
  644. }
  645. &lt;/style&gt;
  646. </code></pre>
  647. <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
  648. <pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
  649. &lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
  650. &lt;/svg&gt;
  651. </code></pre>
  652. </div>
  653. </div>
  654. </div>
  655. </div>
  656. <script>
  657. $(document).ready(function () {
  658. $('.tab-container .content:first').show()
  659. $('#tabs li').click(function (e) {
  660. var tabContent = $('.tab-container .content')
  661. var index = $(this).index()
  662. if ($(this).hasClass('active')) {
  663. return
  664. } else {
  665. $('#tabs li').removeClass('active')
  666. $(this).addClass('active')
  667. tabContent.hide().eq(index).fadeIn()
  668. }
  669. })
  670. })
  671. </script>
  672. </body>
  673. </html>