Extends
Members
(readonly) $editor
编辑器实例
(readonly) $path
对应路径
(readonly) contentLength
内容长度
(readonly) displayType
类型
Methods
_updatePoints(container, position, distance, newContainer)
range端点更新
Parameters:
Name | Type | Description |
---|---|---|
container | * | |
position | * | |
distance | * | |
newContainer | * |
enterPath(path, range, direction) → {*}
光标进入
Parameters:
Name | Type | Description |
---|---|---|
path | * | |
range | * | |
direction | * |
Returns:
- Type:
- *
isCaretShouldLeavePath(path, range, direction) → {Boolean}
检测光标是否要离开当前path
Returns:
- Type:
- Boolean
leavePath(path, range, direction) → {*}
光标离开
Parameters:
Name | Type | Description |
---|---|---|
path | * | |
range | * | |
direction | * | 从哪个方向离开 |
Returns:
- Type:
- *
onCaretMove(direction, range, event) → {*}
光标移动处理
Parameters:
Name | Type | Description |
---|---|---|
direction | * | |
range | * | |
event | * |
Returns:
- Type:
- *
onKeydownArrowDown(range, event)
键盘下箭头处理
Parameters:
Name | Type | Description |
---|---|---|
range | * | |
event | * |
onKeydownArrowLeft(range, event)
键盘左箭头处理
Parameters:
Name | Type | Description |
---|---|---|
range | * | |
event | * |
onKeydownArrowRight(range, event)
键盘右箭头处理
Parameters:
Name | Type | Description |
---|---|---|
range | * | |
event | * |
onKeydownArrowUp(range, event)
键盘上箭头处理
Parameters:
Name | Type | Description |
---|---|---|
range | * | |
event | * |
onKeydownBackspace(range)
键盘空格处理
Parameters:
Name | Type | Description |
---|---|---|
range | * |
onKeydownEnter(range, event)
键盘回车处理
Parameters:
Name | Type | Description |
---|---|---|
range | * | |
event | * |
setComponent(range, callback)
组件设置
Parameters:
Name | Type | Description |
---|---|---|
range | Range | |
callback | function | 格式处理回调 |
setFormat(range, callback)
格式设置
Parameters:
Name | Type | Description |
---|---|---|
range | Range | |
callback | function | 格式处理回调 |
update(path, range) → {*}
更新状态
Parameters:
Name | Type | Description |
---|---|---|
path | * | |
range | * |
Returns:
- Type:
- *
(static) onBeforeRender()
render前调用hook
(static) onInsert({) → {*}
内容插入处理
Parameters:
Name | Type | Description |
---|---|---|
{ | * | data, type, range } |
Returns:
- Type:
- *
(static) onLinefeed(range, eventopt)
换行
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
range | Range | |||
event | event | <optional> | null |