59 lines
1.1 KiB
Vue
59 lines
1.1 KiB
Vue
<template>
|
|
<view class="components-checkbox-icon jc-center ai-center" :class="{'isSelected':isSelected}" @click="change">
|
|
<!-- <image class="icon-hook" :src="webUrl + '/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/> -->
|
|
<u-icon name="checkmark-circle-fill" color="#C52733" v-if="isSelected"></u-icon>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'CheckboxIcon',
|
|
props: {
|
|
defaultState: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
mark: {
|
|
type: Array,
|
|
default: () => {
|
|
return []
|
|
}
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
webUrl: Object.freeze(this.$VUE_APP_RESOURCES_URL)
|
|
}
|
|
},
|
|
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: 2px solid #D5D7D8;
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.icon-hook {
|
|
width: 24rpx;
|
|
height: 24rpx;
|
|
}
|
|
|
|
.isSelected {
|
|
border: 3px solid #C52733;
|
|
}
|
|
</style> |