123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <template>
- <view
- class="u-checkbox-group"
- :class="bemClass"
- >
- <slot></slot>
- </view>
- </template>
- <script>
- import { props } from './props';
- import { mpMixin } from '../../libs/mixin/mpMixin';
- import { mixin } from '../../libs/mixin/mixin';
-
- export default {
- name: 'u-checkbox-group',
- mixins: [mpMixin, mixin,props],
- computed: {
-
-
-
- parentData() {
- return [
-
- this.value,
-
-
- this.modelValue,
-
- 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: {
- handler() {
- if (this.children.length) {
- this.children.map((child) => {
-
- typeof child.init === "function" && child.init();
- });
- }
- },
- deep: true,
- },
- },
- data() {
- return {
- }
- },
- created() {
- this.children = []
- },
-
- emits: ['update:modelValue', 'change'],
-
- methods: {
-
- unCheckedOther(childInstance) {
- const values = []
- this.children.map(child => {
-
- if (child.isChecked) {
- values.push(child.name)
- }
- })
-
- this.$emit('change', values)
-
-
- this.$emit("update:modelValue", values);
-
-
- this.$emit("input", values);
-
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "../../libs/css/components.scss";
- .u-checkbox-group {
- &--row {
-
- display: flex;
-
- flex-flow: row wrap;
- }
- &--column {
- @include flex(column);
- }
- }
- </style>
|