UNPKG

@opentiny/vue-common

Version:

An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.

33 lines (32 loc) 1.43 kB
export declare const emitter: () => { emit(eventName: any): void; on: (event: any, callback: any, once?: boolean) => void; once(event: any, callback: any): void; off(event: any, callback: any): void; }; export declare const bindFilter: (props: any, attrs?: {}) => {}; /** * 根据类名生成对应的hover、active等类名 * * getElementStatusClass('border-color', 'hover') // 'border-color hover:border-color-hover' * getElementStatusClass(['border-color'], ['hover', 'active']) // 'border-color hover:border-color-hover active:border-color-active' * * @method * @param {String|Array} className - 类名 * @param {String|Array} status - 状态 * @returns {String} - 类名拼接的字符串 */ export declare const getElementStatusClass: (className: any, status: any) => string | undefined; /** * 根据key值获取对应的classes类名配置 * * getElementCssClass({ button: 'border-color' }, 'button') // 'border-color' * getElementCssClass({ button: 'border-color' }, { 'button': true }) // 'border-color' * getElementCssClass({ button: 'border-color', 'mini': 'p-1', 'small': 'p-2' }, ['button', 'small']) // 'border-color p-2' * * @method * @param {Object} classes - 类名集合 * @param {String|Object|Array} key - 状态或状态集合 * @returns {String} - 类名配置值 */ export declare const getElementCssClass: (classes: {} | undefined, key: any) => any;