<!-- html文件 -->
<!-- 下面 href 输入自己的链接地址 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1370482_tpbspxmkse.css" />
<template>
<!-- -->
<i :class="classes" :style="styles"></i>
</template>
<script>
export default {
name: "iconfont",
props: {
icon: {
type: String,
default: ""
},
color: {
type: String,
default: "#515a6e"
},
size: {
type: Number,
default: 12
}
},
computed: {
classes() {
return ["iconfont", `${this.icon}`];
},
styles() {
return {
color: this.color,
fontSize: `${this.size}px`
};
}
}
};
</script>
<style lang="scss" scoped>
/* 默认样式 可以自己修改 */
.iconfont {
font-family: "iconfont";
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
</style>
<!-- 传参数即可 -->
<icon-font
color="rgb(204, 193, 93)"
icon="icon-Real-timeCompute-orange"
:size="40"
></icon-font>
<!-- html文件 -->
<!-- 注意下面 src 输入自己的链接地址 -->
<script src="//at.alicdn.com/t/font_1370482_tpbspxmkse.js"></script>