Members
getRect :function
Type:
- function
Methods
addVnodes(parentElm, beforeopt, vnodes, startIdx, endIdx)
增加节点
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
parentElm | * | |||
before | * | <optional> | null | |
vnodes | * | |||
startIdx | * | |||
endIdx | * |
computeOffset(dom, resopt) → {*}
累计偏移量计算
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dom | * | |||
res | * | <optional> | { x: 0, y: 0 } |
Returns:
- Type:
- *
computeScroll(dom, resopt) → {*}
累计滚动距离计算
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dom | * | |||
res | * | <optional> | { x: 0, y: 0 } |
Returns:
- Type:
- *
createKeyToOldIdx(children, beginIdx, endIdx) → {*}
生成id映射
Parameters:
Name | Type | Description |
---|---|---|
children | * | |
beginIdx | * | |
endIdx | * |
Returns:
- Type:
- *
createPath(node, parentopt, prevSiblingopt, nextSiblingopt, indexopt) → {Path}
创建path
Parameters:
Name | Type | Attributes | Default | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
node | Object | 标记Properties
| |||||||||||
parent | Path | <optional> | null | ||||||||||
prevSibling | Path | <optional> | null | ||||||||||
nextSibling | Path | <optional> | null | ||||||||||
index | Number | <optional> | 0 |
Returns:
- Type:
- Path
defer(fn) → {*}
defer
Parameters:
Name | Type | Description |
---|---|---|
fn | function |
Returns:
- Type:
- *
del(range, forceopt)
删除操作
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
range | * | |||
force | boolean | <optional> | false |
findIdxInOld(node, oldCh, start, end) → {*}
在老节点中查找id
Parameters:
Name | Type | Description |
---|---|---|
node | * | |
oldCh | * | |
start | * | |
end | * |
Returns:
- Type:
- *
flush()
调度执行
horizontalMove(direction, range, event) → {*}
水平移动
Parameters:
Name | Type | Description |
---|---|---|
direction | * | |
range | * | |
event | * |
Returns:
- Type:
- *
isSameLine(initialCaretInfo, prevCaretInfo, currCaretInfo, editor) → {Boolean}
光标跨行判断
Parameters:
Name | Type | Description |
---|---|---|
initialCaretInfo | * | |
prevCaretInfo | * | |
currCaretInfo | * | |
editor | * |
Returns:
- Type:
- Boolean
loop(range, direction, initialCaretInfo, prevCaretInfo, lineChanged, shiftKey) → {*}
循环执行函数
Parameters:
Name | Type | Default | Description |
---|---|---|---|
range | * | ||
direction | * | ||
initialCaretInfo | * | ||
prevCaretInfo | * | ||
lineChanged | * | false | |
shiftKey | * |
Returns:
- Type:
- *
patchVnode(vnode, oldVnode)
节点比对
Parameters:
Name | Type | Description |
---|---|---|
vnode | * | |
oldVnode | * |
positionCompare(a, b) → {*}
Parameters:
Name | Type | Description |
---|---|---|
a | * | |
b | * |
- Source
Returns:
0 a===b;-1 ab
- Type:
- *
queryPath(target, path) → {path}
Parameters:
Name | Type | Description |
---|---|---|
target | elm | | |
path | path |
Returns:
- Type:
- path
queryPathByElm(elm) → {*}
根据dom查询path
Parameters:
Name | Type | Description |
---|---|---|
elm | * |
Returns:
- Type:
- *
queryPathByPosition(position, rootPath) → {*}
根据坐标查询path
Parameters:
Name | Type | Description |
---|---|---|
position | * | |
rootPath | * |
Returns:
- Type:
- *
queryPathByVn(vn) → {*}
根据虚拟dom查询path
Parameters:
Name | Type | Description |
---|---|---|
vn | * |
Returns:
- Type:
- *
removeVnodes(parentElm, oldCh, startIdx, endIdx)
节点删除
Parameters:
Name | Type | Description |
---|---|---|
parentElm | * | |
oldCh | * | |
startIdx | * | |
endIdx | * |
renderRoot(h) → {*}
Parameters:
Name | Type | Description |
---|---|---|
h | * |
- Source
Returns:
- Type:
- *
sameVnode(vnode, oldVnode) → {*}
判断是否相同节点
Parameters:
Name | Type | Description |
---|---|---|
vnode | * | |
oldVnode | * |
Returns:
- Type:
- *
setStyle(dom, style)
设置光标的样式
Parameters:
Name | Type | Description |
---|---|---|
dom | * | |
style | * |
updateChildren(parentElm, newCh, oldCh)
children更新函数
Parameters:
Name | Type | Description |
---|---|---|
parentElm | * | |
newCh | * | |
oldCh | * |
verticalMove(range, direction, shiftKey)
垂直移动 垂直移动等效于水平移动N步的结果,关键点在于确定N 这里通过光标位置回溯法,计算出最合适的N
Parameters:
Name | Type | Description |
---|---|---|
range | * | |
direction | * | |
shiftKey | * |