5 changed files with 456 additions and 80 deletions
@ -0,0 +1,52 @@ |
|||||
|
<template> |
||||
|
<text :class="[type,'iconfont-' + name,{'nmr-linear':islinear}]" :style="{'background-image':islinear?linearStyle:'',color: color,'line-height':size + 'rpx', 'font-size': size + 'rpx' }" |
||||
|
@click="_onClick" /> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// 组件使用方法 |
||||
|
// <nmr-icon name="renwu" size="30" color="#ff0000"></nmr-icon> |
||||
|
export default { |
||||
|
name: 'UniIcon', |
||||
|
props: { |
||||
|
type: { |
||||
|
type: String, |
||||
|
default: 'des' |
||||
|
}, |
||||
|
islinear: {//是否渐变图标 |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
linearStyle: {//渐变样式 |
||||
|
type: String, |
||||
|
default: 'linear-gradient(180deg, #64BDE7 0%, #A7D9F3 100%)' |
||||
|
}, |
||||
|
name: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
color: { |
||||
|
type: String, |
||||
|
default: '#333333' |
||||
|
}, |
||||
|
|
||||
|
size: { |
||||
|
type: [Number, String], |
||||
|
default: 32 |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
_onClick() { |
||||
|
this.$emit('click') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.nmr-linear{ |
||||
|
-webkit-background-clip: text; |
||||
|
background-clip: text; |
||||
|
color: transparent !important; |
||||
|
background-image: linear-gradient(180deg, #64BDE7 0%, #A7D9F3 100%); |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,22 @@ |
|||||
|
@font-face { |
||||
|
font-family: "des"; /* Project id 5022607 */ |
||||
|
src: url('//at.alicdn.com/t/c/font_5022607_r74iwur9ql.woff2?t=1757989865177') format('woff2'), |
||||
|
url('//at.alicdn.com/t/c/font_5022607_r74iwur9ql.woff?t=1757989865177') format('woff'), |
||||
|
url('//at.alicdn.com/t/c/font_5022607_r74iwur9ql.ttf?t=1757989865177') format('truetype'); |
||||
|
} |
||||
|
|
||||
|
.des { |
||||
|
font-family: "des" !important; |
||||
|
font-size: 16px; |
||||
|
font-style: normal; |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
-moz-osx-font-smoothing: grayscale; |
||||
|
} |
||||
|
|
||||
|
.iconfont-jifen:before { |
||||
|
content: "\e614"; |
||||
|
} |
||||
|
|
||||
|
.iconfont-jifenduihuan:before { |
||||
|
content: "\e60b"; |
||||
|
} |
Loading…
Reference in new issue