12 |
IconFont 图标
13 |
82 |
83 |
font-class引用
84 |
85 |
86 |
font-class是unicode使用方式的一种变种,主要是解决unicode书写不直观,语意不明确的问题。
87 |
与unicode使用方式相比,具有如下特点:
88 |
89 | - 兼容性良好,支持ie8+,及所有现代浏览器。
90 | - 相比于unicode语意明确,书写更直观。可以很容易分辨这个icon是什么。
91 | - 因为使用class来定义图标,所以当要替换图标时,只需要修改class里面的unicode引用。
92 | - 不过因为本质上还是使用的字体,所以多色图标还是不支持的。
93 |
94 |
使用步骤如下:
95 |
第一步:引入项目下面生成的fontclass代码:
96 |
97 |
98 |
99 |
第二步:挑选相应图标并获取类名,应用于页面:
100 |
<i class="iconfont icon-xxx"></i>
101 |
102 | "iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/leproject/src/components/detaillist.vue:
--------------------------------------------------------------------------------
1 |
32 |
IconFont 图标
33 |
34 |
35 | -
36 |
37 |
房子
38 | 
39 |
40 |
41 | -
42 |
43 |
地址
44 | 
45 |
46 |
47 | -
48 |
49 |
小人
50 | 
51 |
52 |
53 | -
54 |
55 |
QQ企鹅
56 | 
57 |
58 |
59 | -
60 |
61 |
星
62 | 
63 |
64 |
65 | -
66 |
67 |
地址
68 | 
69 |
70 |
71 | -
72 |
73 |
电话
74 | 
75 |
76 |
77 | -
78 |
79 |
小人
80 | 
81 |
82 |
83 | -
84 |
85 |
电话
86 | 
87 |
88 |
89 | -
90 |
91 |
电话
92 | 
93 |
94 |
95 | -
96 |
97 |
查找
98 | 
99 |
100 |
101 |
102 |
unicode引用
103 |
104 |
105 |
unicode是字体在网页端最原始的应用方式,特点是:
106 |
107 | - 兼容性最好,支持ie6+,及所有现代浏览器。
108 | - 支持按字体的方式去动态调整图标大小,颜色等等。
109 | - 但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。
110 |
111 |
112 | 注意:新版iconfont支持多色图标,这些多色图标在unicode模式下将不能使用,如果有需求建议使用symbol的引用方式
113 |
114 |
unicode使用步骤如下:
115 |
第一步:拷贝项目下面生成的font-face
116 |
@font-face {
117 | font-family: 'iconfont';
118 | src: url('iconfont.eot');
119 | src: url('iconfont.eot?#iefix') format('embedded-opentype'),
120 | url('iconfont.woff') format('woff'),
121 | url('iconfont.ttf') format('truetype'),
122 | url('iconfont.svg#iconfont') format('svg');
123 | }
124 |
125 |
第二步:定义使用iconfont的样式
126 |
.iconfont{
127 | font-family:"iconfont" !important;
128 | font-size:16px;font-style:normal;
129 | -webkit-font-smoothing: antialiased;
130 | -webkit-text-stroke-width: 0.2px;
131 | -moz-osx-font-smoothing: grayscale;
132 | }
133 |
134 |
第三步:挑选相应图标并获取字体编码,应用于页面
135 |
<i class="iconfont">3</i>
136 |
137 |
138 | "iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。
139 |
140 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/leproject/src/assets/iconfont/demo_symbol.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
27 |
IconFont 图标
28 |
119 |
120 |
121 |
symbol引用
122 |
123 |
124 |
这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章
125 | 这种用法其实是做了一个svg的集合,与另外两种相比具有如下特点:
126 |
127 | - 支持多色图标了,不再受单色限制。
128 | - 通过一些技巧,支持像字体那样,通过
font-size,color来调整样式。
129 | - 兼容性较差,支持 ie9+,及现代浏览器。
130 | - 浏览器渲染svg的性能一般,还不如png。
131 |
132 |
使用步骤如下:
133 |
第一步:引入项目下面生成的symbol代码:
134 |
135 |
第二步:加入通用css代码(引入一次就行):
136 |
<style type="text/css">
137 | .icon {
138 | width: 1em; height: 1em;
139 | vertical-align: -0.15em;
140 | fill: currentColor;
141 | overflow: hidden;
142 | }
143 | </style>
144 |
第三步:挑选相应图标并获取类名,应用于页面:
145 |
<svg class="icon" aria-hidden="true">
146 | <use xlink:href="#icon-xxx"></use>
147 | </svg>
148 |
149 |
150 |
151 |
152 |
--------------------------------------------------------------------------------
/leproject/src/assets/iconfont1/iconfont.css:
--------------------------------------------------------------------------------
1 |
2 | @font-face {font-family: "iconfont";
3 | src: url('iconfont.eot?t=1493196342498'); /* IE9*/
4 | src: url('iconfont.eot?t=1493196342498#iefix') format('embedded-opentype'), /* IE6-IE8 */
5 | url('iconfont.woff?t=1493196342498') format('woff'), /* chrome, firefox */
6 | url('iconfont.ttf?t=1493196342498') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7 | url('iconfont.svg?t=1493196342498#iconfont') format('svg'); /* iOS 4.1- */
8 | }
9 |
10 | .iconfont {
11 | font-family:"iconfont" !important;
12 | font-size:16px;
13 | font-style:normal;
14 | -webkit-font-smoothing: antialiased;
15 | -moz-osx-font-smoothing: grayscale;
16 | }
17 |
18 | .icon-all:before { content: "\e696"; }
19 |
20 | .icon-back:before { content: "\e697"; }
21 |
22 | .icon-cart:before { content: "\e698"; }
23 |
24 | .icon-category:before { content: "\e699"; }
25 |
26 | .icon-close:before { content: "\e69a"; }
27 |
28 | .icon-comments:before { content: "\e69b"; }
29 |
30 | .icon-cry:before { content: "\e69c"; }
31 |
32 | .icon-delete:before { content: "\e69d"; }
33 |
34 | .icon-edit:before { content: "\e69e"; }
35 |
36 | .icon-email:before { content: "\e69f"; }
37 |
38 | .icon-favorite:before { content: "\e6a0"; }
39 |
40 | .icon-folder:before { content: "\e6a1"; }
41 |
42 | .icon-form:before { content: "\e6a2"; }
43 |
44 | .icon-help:before { content: "\e6a3"; }
45 |
46 | .icon-information:before { content: "\e6a4"; }
47 |
48 | .icon-less:before { content: "\e6a5"; }
49 |
50 | .icon-moreunfold:before { content: "\e6a6"; }
51 |
52 | .icon-more:before { content: "\e6a7"; }
53 |
54 | .icon-pic:before { content: "\e6a8"; }
55 |
56 | .icon-qrcode:before { content: "\e6a9"; }
57 |
58 | .icon-refresh:before { content: "\e6aa"; }
59 |
60 | .icon-rfq:before { content: "\e6ab"; }
61 |
62 | .icon-search:before { content: "\e6ac"; }
63 |
64 | .icon-selected:before { content: "\e6ad"; }
65 |
66 | .icon-set:before { content: "\e6ae"; }
67 |
68 | .icon-smile:before { content: "\e6af"; }
69 |
70 | .icon-success:before { content: "\e6b1"; }
71 |
72 | .icon-survey:before { content: "\e6b2"; }
73 |
74 | .icon-training:before { content: "\e6b3"; }
75 |
76 | .icon-viewgallery:before { content: "\e6b4"; }
77 |
78 | .icon-viewlist:before { content: "\e6b5"; }
79 |
80 | .icon-warning:before { content: "\e6b6"; }
81 |
82 | .icon-wrong:before { content: "\e6b7"; }
83 |
84 | .icon-account:before { content: "\e6b8"; }
85 |
86 | .icon-add:before { content: "\e6b9"; }
87 |
88 | .icon-atm:before { content: "\e6ba"; }
89 |
90 | .icon-clock:before { content: "\e6bb"; }
91 |
92 | .icon-remind:before { content: "\e6bc"; }
93 |
94 | .icon-calendar:before { content: "\e6bf"; }
95 |
96 | .icon-attachment:before { content: "\e6c0"; }
97 |
98 | .icon-3column:before { content: "\e6c3"; }
99 |
100 | .icon-4column:before { content: "\e6c4"; }
101 |
102 | .icon-discount:before { content: "\e6c5"; }
103 |
104 | .icon-service:before { content: "\e6c7"; }
105 |
106 | .icon-print:before { content: "\e6c9"; }
107 |
108 | .icon-box:before { content: "\e6cb"; }
109 |
110 | .icon-process:before { content: "\e6ce"; }
111 |
112 | .icon-bags:before { content: "\e6d1"; }
113 |
114 | .icon-beauty:before { content: "\e6d2"; }
115 |
116 | .icon-electrical:before { content: "\e6d4"; }
117 |
118 | .icon-electronics:before { content: "\e6da"; }
119 |
120 | .icon-gifts:before { content: "\e6db"; }
121 |
122 | .icon-apparel:before { content: "\e6dc"; }
123 |
124 | .icon-atmaway:before { content: "\e6e9"; }
125 |
126 | .icon-rfq1:before { content: "\e6eb"; }
127 |
128 | .icon-scanning:before { content: "\e6ec"; }
129 |
130 | .icon-filter:before { content: "\e6f1"; }
131 |
132 | .icon-pin:before { content: "\e6f2"; }
133 |
134 | .icon-history:before { content: "\e6f3"; }
135 |
136 | .icon-productfeatures:before { content: "\e6f4"; }
137 |
138 | .icon-supplierfeatures:before { content: "\e6f5"; }
139 |
140 | .icon-similarproduct:before { content: "\e6f6"; }
141 |
142 | .icon-link:before { content: "\e6f7"; }
143 |
144 | .icon-cut:before { content: "\e6f8"; }
145 |
146 | .icon-navlist:before { content: "\e6fa"; }
147 |
148 | .icon-imagetext:before { content: "\e6fb"; }
149 |
150 | .icon-text:before { content: "\e6fc"; }
151 |
152 | .icon-move:before { content: "\e6fd"; }
153 |
154 | .icon-subtract:before { content: "\e6fe"; }
155 |
156 | .icon-dollar:before { content: "\e702"; }
157 |
158 | .icon-raw:before { content: "\e704"; }
159 |
160 | .icon-office:before { content: "\e705"; }
161 |
162 | .icon-agriculture:before { content: "\e707"; }
163 |
164 | .icon-machinery:before { content: "\e709"; }
165 |
166 | .icon-assessedbadge:before { content: "\e70a"; }
167 |
168 | .icon-gerenzhongxin:before { content: "\e70b"; }
169 |
170 | .icon-jifen:before { content: "\e70c"; }
171 |
172 | .icon-operation:before { content: "\e70e"; }
173 |
174 | .icon-remind1:before { content: "\e713"; }
175 |
176 | .icon-icondownload:before { content: "\e714"; }
177 |
178 | .icon-map:before { content: "\e715"; }
179 |
180 | .icon-good:before { content: "\e717"; }
181 |
182 | .icon-skip:before { content: "\e718"; }
183 |
184 | .icon-iconfontplay2:before { content: "\e719"; }
185 |
186 | .icon-iconfontstop:before { content: "\e71a"; }
187 |
188 | .icon-compass:before { content: "\e71b"; }
189 |
190 | .icon-security:before { content: "\e71c"; }
191 |
192 | .icon-share:before { content: "\e71d"; }
193 |
194 | .icon-store:before { content: "\e722"; }
195 |
196 | .icon-rejectedorder:before { content: "\e724"; }
197 |
198 | .icon-phone:before { content: "\e725"; }
199 |
200 | .icon-bussinessman:before { content: "\e726"; }
201 |
202 | .icon-mobilephone:before { content: "\e72a"; }
203 |
204 | .icon-emailfilling:before { content: "\e72d"; }
205 |
206 | .icon-favoritesfilling:before { content: "\e730"; }
207 |
208 | .icon-accountfilling:before { content: "\e732"; }
209 |
210 | .icon-creditlevelfilling:before { content: "\e736"; }
211 |
212 | .icon-exl:before { content: "\e73f"; }
213 |
214 | .icon-pdf:before { content: "\e740"; }
215 |
216 | .icon-zip:before { content: "\e741"; }
217 |
218 | .icon-sorting:before { content: "\e743"; }
219 |
220 | .icon-copy:before { content: "\e744"; }
221 |
222 | .icon-hot:before { content: "\e756"; }
223 |
224 | .icon-trade:before { content: "\e758"; }
225 |
226 | .icon-component:before { content: "\e75e"; }
227 |
228 | .icon-color:before { content: "\e760"; }
229 |
230 | .icon-color-filling:before { content: "\e7cd"; }
231 |
232 | .icon-favorites:before { content: "\e7ce"; }
233 |
234 | .icon-RFQ:before { content: "\e803"; }
235 |
236 | .icon-originalimage:before { content: "\e806"; }
237 |
238 | .icon-logistic:before { content: "\e811"; }
239 |
240 | .icon-video:before { content: "\e820"; }
241 |
242 |
--------------------------------------------------------------------------------
/leproject/src/assets/iconfont/demo.css:
--------------------------------------------------------------------------------
1 | *{margin: 0;padding: 0;list-style: none;}
2 | /*
3 | KISSY CSS Reset
4 | 理念:1. reset 的目的不是清除浏览器的默认样式,这仅是部分工作。清除和重置是紧密不可分的。
5 | 2. reset 的目的不是让默认样式在所有浏览器下一致,而是减少默认样式有可能带来的问题。
6 | 3. reset 期望提供一套普适通用的基础样式。但没有银弹,推荐根据具体需求,裁剪和修改后再使用。
7 | 特色:1. 适应中文;2. 基于最新主流浏览器。
8 | 维护:玉伯