You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.1 KiB
52 lines
1.1 KiB
<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>
|
|
|