optimized

This commit is contained in:
2023-04-06 00:08:03 +08:00
parent adb74b7441
commit c27d44872b
11 changed files with 314 additions and 91 deletions

View File

@ -22,43 +22,43 @@
onchange?: (this: HTMLInputElement, ev: Event) => any;
}</pre>
</p>
<h3>type?: string</h3>
<h4>type?: string</h4>
<p>
复选框图标的样式,可选值目前有 <code>fa-regular</code><code>fa-light</code><code>fa-solid</code>
</p>
<h3>label?: string | HTMLElement</h3>
<h4>label?: string | HTMLElement</h4>
<p>
复选框的标签文本,或者想要呈现的元素
</p>
<h3>checked?: boolean</h3>
<h4>checked?: boolean</h4>
<p>
初始是否选中
</p>
<h3>isImage?: boolean</h3>
<h4>isImage?: boolean</h4>
<p>
是否为图片复选框
</p>
<h3>imageHeight?: Number</h3>
<h4>imageHeight?: Number</h4>
<p>
为图片复选框时的图片限制高度
</p>
<h3>checkedNode?: HTMLElement</h3>
<h4>checkedNode?: HTMLElement</h4>
<p>
为图片复选框时的选中时显示的元素
</p>
<h3>uncheckedNode?: HTMLElement</h3>
<h4>uncheckedNode?: HTMLElement</h4>
<p>
为图片复选框时的未选中时显示的元素
</p>
<h3>customerAttributes?: { [key: string]: string }</h3>
<h4>customerAttributes?: { [key: string]: string }</h4>
<p>
自定义属性,例如
<pre>{
<pre>{
'data-id': 'xxxxxx',
'disabled': ''
}</pre>
</p>
<h3>onchange?: (this: HTMLInputElement, ev: Event) => any</h3>
<h4>onchange?: (this: HTMLInputElement, ev: Event) => any</h4>
<p>
复选框改变时触发的事件
</p>
@ -66,7 +66,8 @@
<code>function resolveCheckbox(container?: HTMLElement, legacy?: boolean): HTMLElement</code>
<h3>container?: HTMLElement</h3>
<p>
将把此 HTML 元素,为 null 则把 document.body 下的所有 <code>label[data-checkbox]</code> 元素解析为复选框,<code>[data-id]</code> 为复选框元素的 id包含
将把此 HTML 元素,为 null 则把 document.body 下的所有 <code>label[data-checkbox]</code> 元素解析为复选框,<code>[data-id]</code> 为复选框元素的
id包含
<code>[data-checked]</code> 时复选框默认选中。
</p>
<p>当该元素无子元素时,<code>[data-type]</code> 同上述参数中的 <code>type?: string</code><code>[data-label]</code> 同上述参数中的