xx-applets/src/components/widgets/checkbox.vue

42 lines
796 B
Vue

<template>
<view class="checkbox" :class="{ active: checked }" :style="{ fontSize: $utils.rpx2px(size) + 'px' }">
<text class="iconfont" :class="[checked ? 'icon-xuanzeyixuanze' : 'icon-xuanzeweixuanze']"></text>
</view>
</template>
<script>
export default {
name: "widget-checkbox",
data() {
return {};
},
props: {
size: {
type: Number,
default: 40,
},
checked: {
type: Boolean,
default: false,
},
},
components: {},
created() {},
mounted() {},
destroyed() {},
methods: {},
};
</script>
<style lang="less" scoped>
.checkbox {
.iconfont {
color: #c7c7c7;
}
}
.checkbox.active {
.iconfont {
color: #8194f2;
}
}
</style>