Browse Source

fix(checkbox): async change value , emit change fn

richard1015 3 years ago
parent
commit
690f8cbf1c
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/packages/__VUE/checkbox/common.ts

+ 7 - 0
src/packages/__VUE/checkbox/common.ts

@@ -89,6 +89,13 @@ export const component = (componentName: string, nutIcon: object) => {
         emit('change', value, label);
       };
 
+      watch(
+        () => props.modelValue,
+        (v) => {
+          emit('change', v);
+        }
+      );
+
       const renderIcon = () => {
         const { iconName, iconSize, iconActiveName, iconClassPrefix, iconFontClassName, iconIndeterminateName } = props;
         return h(nutIcon, {