MCPcopy Create free account
hub / github.com/WhiteSevs/TamperMonkeyScript / createElement

Method createElement

lib/pops/src/utils/PopsDOMUtils.ts:1977–2024  ·  view source on GitHub ↗

* 创建元素 * @param tagName 标签名 * @param property 属性 * @param attributes 元素上的自定义属性 * @example * // 创建一个DIV元素,且属性class为xxx * DOMUtils.createElement("div",undefined,{ class:"xxx" }); * > * @example * // 创建一个DIV元素 * DOMUtils.createElement("div"); * >

(
    /** 元素名 */
    tagName: K,
    /** 属性 */
    property?:
      | ({
          [P in keyof HTMLElementTagNameMap[K]]?: HTMLElementTagNameMap[K][P] extends string | boolean | number
            ? HTMLElementTagNameMap[K][P]
            : never;
        } & {
          [key: string]: any;
        })
      | string,
    /** 自定义属性 */
    attributes?: PopsDOMUtilsCreateElementAttributesMap
  )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 15

parseTextToDOMMethod · 0.95
initFunction · 0.45
createToolTipMethod · 0.45
createBottomItemFunction · 0.45
createAsideItemFunction · 0.45
addValidErrorMsgFunction · 0.45
initOptionFunction · 0.45

Calls 5

forEachMethod · 0.80
stringifyMethod · 0.80
setMethod · 0.65
toStringMethod · 0.65
keysMethod · 0.45

Tested by

no test coverage detected