/** * @description 绑定事件 * @param { HTMLElement | Document | Window } element 绑定事件元素对象 * @param { String } event 事件名称 * @param {EventListenerOrEventListenerObject } handler 事件函数 * @param { Boolean } useCapture 指定事件是否在捕获或冒泡阶段执行 true(捕获) false(冒泡) * @example on(ctx.$el, 'click', funName) */ export declare const on: (element: Element, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void; /** * @description 解绑事件 * @param { HTMLElement | Document | Window } element 绑定事件元素对象 * @param { String } event 事件名称 * @param { EventListenerOrEventListenerObject } handler 事件函数 * @param { Boolean } useCapture 指定事件是否在捕获或冒泡阶段执行 true(捕获) false(冒泡) * @example off(ctx.$el, 'click', funName) */ export declare const off: (element: Element, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void; /** * @description 绑定事件仅绑定一次 * @param {HTMLElement} el 绑定事件元素对象 * @param {String} event 事件名称 * @param {EventListener} fn 事件函数 * @example once(ctx.$el, 'click', funName); */ export declare const once: (el: HTMLElement, event: string, fn: EventListener) => void; /** * @description 判断某个元素是不是包含指定的calssName * @param {HTMLElement | Element} el * @param { String } cls * @returns { Boolean } true|false * @example hasClass(ctx.$el, 'home') => true | false */ export declare function hasClass(el: HTMLElement, cls: string): boolean; /** * @description 为某个元素对象添加className * @param { HTMLElement | Element } el 元素对象 * @param { String } cls class样式名称 * @returns * @example * 原元素
* addClass(ctx.$el, 'cls1 cls2') => */ export declare function addClass(el: HTMLElement, cls: string): void; /** * @description 为某个元素对象移除className * @param { HTMLElement | Element } el 元素对象 * @param {String } cls class样式名称 * @returns * @example * 原元素 * removeClass(ctx.$el, 'home5 home2') => */ export declare function removeClass(el: HTMLElement, cls: string): void; /** * @description 获取指定元素对象的 style 样式 * @param { HTMLElement } element 元素对象 * @param {String } styleName 样式字段 * @returns * @example * 场景1:内嵌式 => => getStyle(ctx.$el, 'fontSize') => 30px * 场景2:定义css样式 => && .home {font-size: 14px; ...} => getStyle(ctx.$el, 'fontSize') => 14px * 场景3:未定义css样式 => => getStyle(ctx.$el, 'fontSize') => 16px 获取继承样式 */ export declare const getStyle: (element: HTMLElement, styleName: any) => string; /** * @description 设置元素的样式,可以设置单个样式属性、值及样式组合对象 * @param { HTMLElement } element 元素对象 * @param { CSSProperties | String } styleName 样式对象|字段 * @param { String || '' } value 样式值 * @returns * @example * 原元素