uniapp checkbox二次封装
使用
<div class="xieyi">
<checkboxCom :value.sync="xieyi" title="登录即代表您同意"></checkboxCom>
<text @click="goUrl">《畅牛云用户与隐私协议》</text>
</div>
封装代码
/**
* @Author: 858834013@qq.com
* @Name: checkboxCom
* @Date: 2023年07月04日10:08:44
* @Desc: checkbox封装同步选择
*/
<template>
<view>
<u-checkbox-group @change="change">
<u-checkbox :checked="value" size='16' labelSize='14' labelColor="#525581" activeColor='rgba(65, 135, 255, 1.00)' shape="circle" :label="title"></u-checkbox>
</u-checkbox-group>
</view>
</template>
<script>
export default {
props: {
value: {
type: Boolean,
default () {
return false
}
},
title: {
type: String,
default () {
return ''
}
},
},
methods: {
change() {
this.$emit("update:value", !this.value)
},
}
}
</script>
<style lang="scss">
</style>