ソースを参照

fix(checkbox): 修复checkboxgroup的disabled的属性不是响应式的问题 (#1113)

* fix(checkbox): 修复checkboxgroup的disabled的属性不是响应式的问题
AsherSun 3 年 前
コミット
3f5341ac84

+ 1 - 1
src/packages/__VUE/checkbox/index.taro.vue

@@ -52,7 +52,7 @@ export default create({
     });
     });
 
 
     const pDisabled = computed(() => {
     const pDisabled = computed(() => {
-      return hasParent.value ? parent.disabled : props.disabled;
+      return hasParent.value ? parent.disabled.value : props.disabled;
     });
     });
 
 
     const checked = computed(() => !!props.modelValue);
     const checked = computed(() => !!props.modelValue);

+ 1 - 1
src/packages/__VUE/checkbox/index.vue

@@ -53,7 +53,7 @@ export default create({
     });
     });
 
 
     const pDisabled = computed(() => {
     const pDisabled = computed(() => {
-      return hasParent.value ? parent.disabled : props.disabled;
+      return hasParent.value ? parent.disabled.value : props.disabled;
     });
     });
 
 
     const checked = computed(() => !!props.modelValue);
     const checked = computed(() => !!props.modelValue);

+ 3 - 11
src/packages/__VUE/checkboxgroup/index.vue

@@ -1,13 +1,5 @@
 <script lang="ts">
 <script lang="ts">
-import {
-  h,
-  watch,
-  provide,
-  computed,
-  ComponentInternalInstance,
-  reactive,
-  ComponentPublicInstance
-} from 'vue';
+import { h, watch, provide, computed, ComponentInternalInstance, reactive, ComponentPublicInstance } from 'vue';
 import { createComponent } from '../../utils/create';
 import { createComponent } from '../../utils/create';
 import { useExpose } from '../../utils/useExpose/index';
 import { useExpose } from '../../utils/useExpose/index';
 const { create, componentName } = createComponent('checkboxgroup');
 const { create, componentName } = createComponent('checkboxgroup');
@@ -52,14 +44,14 @@ export default create({
 
 
     provide('parent', {
     provide('parent', {
       value: computed(() => props.modelValue),
       value: computed(() => props.modelValue),
-      disabled: props.disabled,
+      disabled: computed(() => props.disabled),
       updateValue,
       updateValue,
       relation
       relation
     });
     });
 
 
     watch(
     watch(
       () => props.modelValue,
       () => props.modelValue,
-      value => {
+      (value) => {
         emit('change', value);
         emit('change', value);
       }
       }
     );
     );