54 lines
1004 B
Vue
54 lines
1004 B
Vue
<template>
|
|
<view class="components-checkbox-icon jc-center ai-center" :class="{'isSelected':isSelected}" @click="change">
|
|
<image class="icon-hook" :src="$VUE_APP_RESOURCES_URL+'/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'CheckboxIcon',
|
|
props: {
|
|
defaultState: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
mark: {
|
|
type: Array,
|
|
default: () => {
|
|
return []
|
|
}
|
|
}
|
|
},
|
|
computed: {
|
|
isSelected: function() {
|
|
return this.defaultState
|
|
}
|
|
},
|
|
methods: {
|
|
change() {
|
|
this.$emit('change', !this.isSelected, this.mark)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.components-checkbox-icon {
|
|
display: inline-flex;
|
|
width: 32rpx;
|
|
height: 32rpx;
|
|
box-sizing: border-box;
|
|
border: 2rpx solid #D5D7D8;
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.icon-hook {
|
|
width: 24rpx;
|
|
height: 24rpx;
|
|
}
|
|
|
|
.isSelected {
|
|
border: 3px solid #FD5749;
|
|
background: #FD5749;
|
|
}
|
|
</style> |