yxk_h5_master/components/lb-picker/m-icon/m-icon.vue

42 lines
669 B
Vue
Raw Normal View History

2025-08-28 15:21:09 +08:00
<template>
<view class="m-icon" :class="['m-icon-'+type]" :style="{color:color,'font-size':fontSize}" @click="onClick()"></view>
</template>
<script>
export default {
props: {
/**
* 图标类型
*/
type: String,
/**
* 图标颜色
*/
color: String,
/**
* 图标大小
*/
size: {
type: [Number, String],
default: 24
}
},
computed: {
fontSize() {
var size = Number(this.size)
size = isNaN(size) ? 24 : size
return `${size}px`
}
},
methods: {
onClick() {
this.$emit('click')
}
}
}
</script>
<style>
@import "./m-icon.css";
</style>