浏览代码

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

richard1015 3 年之前
父节点
当前提交
690f8cbf1c
共有 1 个文件被更改,包括 7 次插入0 次删除
  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, {