mirror of
https://github.com/layui/layui.git
synced 2026-02-09 02:09:18 +08:00
docs: 优化部分注释文案,避免非技术人员理解错位
尽量避免词汇:监听、侦听。可用事件「触发」或「响应」等相近含义的词语替代
This commit is contained in:
@@ -680,15 +680,15 @@
|
||||
}();
|
||||
|
||||
/**
|
||||
* 监听指定元素外部的点击
|
||||
* @param {HTMLElement} target - 被监听的元素
|
||||
* 绑定指定元素外部的点击事件
|
||||
* @param {HTMLElement} target - 响应事件的元素
|
||||
* @param {(e: Event) => void} handler - 事件触发时执行的函数
|
||||
* @param {object} [options] - 选项
|
||||
* @param {string} [options.event="pointerdown"] - 监听的事件类型
|
||||
* @param {HTMLElement | Window} [options.scope=document] - 监听范围
|
||||
* @param {Array<HTMLElement | string>} [options.ignore] - 忽略监听的元素或选择器字符串
|
||||
* @param {boolean} [options.capture=true] - 对内部事件侦听器使用捕获阶段
|
||||
* @returns {() => void} - 返回一个停止事件监听的函数
|
||||
* @param {string} [options.event="pointerdown"] - 事件类型
|
||||
* @param {HTMLElement | Window} [options.scope=document] - 事件范围
|
||||
* @param {Array<HTMLElement | string>} [options.ignore] - 忽略触发事件的元素或选择器字符串
|
||||
* @param {boolean} [options.capture=true] - 对内部事件 listener 使用捕获阶段
|
||||
* @returns {() => void} - 返回一个停止事件响应的函数
|
||||
*/
|
||||
lay.onClickOutside = function(target, handler, options){
|
||||
options = options || {};
|
||||
|
||||
Reference in New Issue
Block a user