diff --git a/libs/horizon/src/dom/valueHandler/index.ts b/libs/horizon/src/dom/valueHandler/index.ts index b716a27f..178727d5 100644 --- a/libs/horizon/src/dom/valueHandler/index.ts +++ b/libs/horizon/src/dom/valueHandler/index.ts @@ -22,32 +22,32 @@ import { } from './TextareaValueHandler'; // 获取元素除了被代理的值以外的属性 -function getPropsWithoutValue(type: string, dom: HorizonDom, properties: Props) { +function getPropsWithoutValue(type: string, dom: HorizonDom, props: Props) { switch (type) { case 'input': - return getInputPropsWithoutValue(dom, properties); + return getInputPropsWithoutValue(dom, props); case 'option': - return getOptionPropsWithoutValue(dom, properties); + return getOptionPropsWithoutValue(dom, props); case 'select': - return getSelectPropsWithoutValue(dom, properties); + return getSelectPropsWithoutValue(dom, props); case 'textarea': - return getTextareaPropsWithoutValue(dom, properties); + return getTextareaPropsWithoutValue(dom, props); default: - return properties; + return props; } } // 其它属性挂载完成后处理被代理值相关的属性 -function setInitValue(type: string, dom: HorizonDom, properties: Props) { +function setInitValue(type: string, dom: HorizonDom, props: Props) { switch (type) { case 'input': - setInitInputValue(dom, properties); + setInitInputValue(dom, props); break; case 'select': - updateSelectValue(dom, properties, true); + updateSelectValue(dom, props, true); break; case 'textarea': - updateTextareaValue(dom, properties, true); + updateTextareaValue(dom, props, true); break; default: break; @@ -55,16 +55,16 @@ function setInitValue(type: string, dom: HorizonDom, properties: Props) { } // 更新需要适配的属性 -function updateValue(type: string, dom: HorizonDom, properties: Props) { +function updateValue(type: string, dom: HorizonDom, props: Props) { switch (type) { case 'input': - updateInputValue(dom, properties); + updateInputValue(dom, props); break; case 'select': - updateSelectValue(dom, properties); + updateSelectValue(dom, props); break; case 'textarea': - updateTextareaValue(dom, properties); + updateTextareaValue(dom, props); break; default: break; diff --git a/libs/horizon/src/event/FormValueController.ts b/libs/horizon/src/event/FormValueController.ts index 7b522ff5..931f33b2 100644 --- a/libs/horizon/src/event/FormValueController.ts +++ b/libs/horizon/src/event/FormValueController.ts @@ -58,7 +58,7 @@ function controlValue(target: Element) { function controlInputValue(inputDom: HTMLInputElement, props: Props) { const { name, type } = props; - // 如果是 radio,先更新相同 name 的 radio + // 如果是 radio,找出同一form内,name相同的Radio,更新它们Handler的Value if (type === 'radio' && name != null) { const radioList = document.querySelectorAll(`input[type="radio"][name="${name}"]`); for (let i = 0; i < radioList.length; i++) {