forked from alibaba/weex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iconfont.we
59 lines (54 loc) · 1.58 KB
/
iconfont.we
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
<div>
<text class="title1">Assets: </text>
<text class="title2">http ttf: </text>
<text class="title3">http woff: </text>
<text class="title4">file: </text>
</div>
</template>
<style>
.title1 {
color: red;
font-size: 36;
font-family: iconfont1;
}
.title2 {
color: red;
font-size: 36;
font-family: iconfont2;
}
.title3 {
color: red;
font-size: 36;
font-family: iconfont3;
}
.title4 {
color: red;
font-size: 36;
font-family: iconfont4;
}
</style>
<script>
module.exports = {
created: function() {
var domModule = require('@weex-module/dom');
//目前支持ttf、woff文件,不支持svg、eot类型
domModule.addRule('font-face', {
'font-family': "iconfont1",
'src' : "url('iconfont.ttf')"
});
domModule.addRule('font-face', {
'font-family': "iconfont2",
'src': "url('http://at.alicdn.com/t/font_1469606063_76593.ttf')"
});
domModule.addRule('font-face', {
'font-family': "iconfont3",
'src': "url('http://at.alicdn.com/t/font_1469606522_9417143.woff')"
});
domModule.addRule('font-face', {
'font-family': "iconfont4",
'src': "url('file:///storage/emulated/0/Android/data/com.alibaba.weex/cache/http:__at.alicdn.com_t_font_1469606063_76593.ttf')"
});
}
}
</script>