注明:如果要改变图标大小和颜色需要写在text标签中
<template>
<view><text class="icon"></text></view>
</template>
<script>
export default {
data() {
return {
}
},
beforeCreate() {
const domModule = weex.requireModule('dom')
domModule.addRule('fontFace', {
fontFamily: "iconfont",
'src': "url('../../../static/iconfont.ttf')"
});
},
created() {
},
methods: {
}
}
</script>
<style>
.icon {
color: red;
font-family: iconfont;
font-size: 30upx;
font-weight: 400;
}
</style>