Class: Uii
A Base class for all Uii classes
Hierarchy
Uii
↳Splittable
↳Resizable
↳Draggable
↳Droppable
↳Rotatable
↳Selectable
Constructors
constructor
• new Uii(ele, opts?)
Parameters
| Name | Type |
|---|---|
ele | string | HTMLElement | NodeList | HTMLCollection | (string | HTMLElement) |
opts? | Record<string, any> |
Properties
ele
• Protected ele: HTMLElement
处理过的dom元素数组
enabled
• Protected enabled: boolean = true
opts
• Protected opts: Record<string, any>
当前uii对象的选项
Methods
destroy
▸ destroy(): void
销毁uii对象,包括卸载事件、清空元素等
Returns
void
disable
▸ disable(): void
禁用uii实例,禁用后的dom不会响应事件
Returns
void
enable
▸ enable(): void
启用uii实例
Returns
void
getOption
▸ getOption(): Record<string, any>
获取uii实例选项对象
Returns
Record<string, any>
registerEvent
▸ Protected registerEvent(el, event, hook, useCapture?): void
注册事件,以便在destroy方法中卸载
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
el | HTMLElement | undefined | dom元素 |
event | string | undefined | 事件名 |
hook | Function | undefined | 回调函数 |
useCapture | boolean | false | 默认false |
Returns
void
setOption
▸ setOption(name, value): void
设置指定name的选项值。触发onOptionChanged
Parameters
| Name | Type |
|---|---|
name | string |
value | any |
Returns
void
setOptions
▸ setOptions(options?): void
一次设置多个选项值。触发onOptionChanged
Parameters
| Name | Type |
|---|---|
options? | Record<string, any> |
Returns
void