123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <template>
- <view
- class="u-checkbox-group"
- :class="bemClass"
- >
- <slot></slot>
- </view>
- </template>
- <script>
- import props from './props.js';
-
- export default {
- name: 'u-checkbox-group',
- mixins: [uni.$u.mpMixin, uni.$u.mixin,props],
- computed: {
-
-
-
- parentData() {
- return [this.value, this.disabled, this.inactiveColor, this.activeColor, this.size, this.labelDisabled, this.shape,
- this.iconSize, this.borderBottom, this.placement
- ]
- },
- bemClass() {
-
- return this.bem('checkbox-group', ['placement'])
- },
- },
- watch: {
-
- parentData() {
- if (this.children.length) {
- this.children.map(child => {
-
- typeof(child.init) === 'function' && child.init()
- })
- }
- },
- },
- data() {
- return {
- }
- },
- created() {
- this.children = []
- },
- methods: {
-
- unCheckedOther(childInstance) {
- const values = []
- this.children.map(child => {
-
- if (child.isChecked) {
- values.push(child.name)
- }
- })
-
- this.$emit('change', values)
-
- this.$emit('input', values)
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "../../libs/css/components.scss";
- .u-checkbox-group {
- &--row {
- @include flex;
- }
- &--column {
- @include flex(column);
- }
- }
- </style>
|