Skip to content

pantoken / formats/interactions/src / initInPlaceEdit

函数: initInPlaceEdit()

initInPlaceEdit(host, dispatchOn): void

为可编辑(contenteditable)字段连接点击编辑的提交/还原行为。 Enter 提交,Escape 还原;如果值已更改,失焦也会提交。 在提交时触发一个向上冒泡的 change CustomEvent,携带 detail.value

CSS: host = .instui-in-place-edit 元素(即 contenteditable) WC: host = shadow .instui-in-place-edit span

参数

host

HTMLElement

dispatchOn

HTMLElement

返回值

void