From 1f9e43b7bbb848c7ee2aaa89ffece17002b2c915 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 16 一月 2026 17:31:08 +0800
Subject: [PATCH] 2026.1.16

---
 miniprogram_npm/tdesign-miniprogram/common/src/control.js |   41 +----------------------------------------
 1 files changed, 1 insertions(+), 40 deletions(-)

diff --git a/miniprogram_npm/tdesign-miniprogram/common/src/control.js b/miniprogram_npm/tdesign-miniprogram/common/src/control.js
index 03c9e77..9010a19 100644
--- a/miniprogram_npm/tdesign-miniprogram/common/src/control.js
+++ b/miniprogram_npm/tdesign-miniprogram/common/src/control.js
@@ -1,40 +1 @@
-const defaultOption = {
-    valueKey: 'value',
-    defaultValueKey: 'defaultValue',
-    changeEventName: 'change',
-    strict: true,
-};
-function useControl(option = {}) {
-    const { valueKey, defaultValueKey, changeEventName, strict } = Object.assign(Object.assign({}, defaultOption), option);
-    const props = this.properties || {};
-    const value = props[valueKey];
-    const defaultValue = props[strict ? defaultValueKey : valueKey];
-    let controlled = false;
-    if (strict && typeof value !== 'undefined' && value !== null) {
-        controlled = true;
-    }
-    const set = (newVal, extObj, fn) => {
-        this.setData(Object.assign({ [`_${valueKey}`]: newVal }, extObj), fn);
-    };
-    return {
-        controlled,
-        initValue: controlled ? value : defaultValue,
-        set,
-        get: () => {
-            return this.data[`_${valueKey}`];
-        },
-        change: (newVal, customChangeData, customUpdateFn) => {
-            this.triggerEvent(changeEventName, typeof customChangeData !== 'undefined' ? customChangeData : newVal);
-            if (controlled) {
-                return;
-            }
-            if (typeof customUpdateFn === 'function') {
-                customUpdateFn();
-            }
-            else {
-                set(newVal);
-            }
-        },
-    };
-}
-export { useControl };
+const defaultOption={valueKey:"value",defaultValueKey:"defaultValue",changeEventName:"change",strict:!0};function useControl(e={}){const{valueKey:t,defaultValueKey:a,changeEventName:n,strict:s}=Object.assign(Object.assign({},defaultOption),e),l=this.properties||{},i=l[t],u=l[s?a:t];let o=!1;s&&null!=i&&(o=!0);const c=(e,a,n)=>{this.setData(Object.assign({[`_${t}`]:e},a),n)};return{controlled:o,initValue:o?i:u,set:c,get:()=>this.data[`_${t}`],change:(e,t,a)=>{this.triggerEvent(n,void 0!==t?t:e),o||("function"==typeof a?a():c(e))}}}export{useControl};
\ No newline at end of file

--
Gitblit v1.9.3