MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / mountElement

Function mountElement

tech-study.js:1923–1932  ·  view source on GitHub ↗

* @description 挂载元素 * @param eleOptions * @param parent

(eleOptions, parent = document.body)

Source from the content-addressed store, hash-verified

1921 * @param parent
1922 */
1923function mountElement(eleOptions, parent = document.body) {
1924 const { ele, beforeMount, onMounted } = eleOptions;
1925 if (ele) {
1926 // 触发挂载前事件
1927 beforeMount && beforeMount();
1928 parent.appendChild(ele);
1929 // 挂在后
1930 onMounted && onMounted();
1931 }
1932}
1933/**
1934 * @description 选择器
1935 * @param selector

Callers 4

renderTipFunction · 0.70
renderPanelFunction · 0.70
renderFrameFunction · 0.70
createTipFunction · 0.70

Calls 1

onMountedFunction · 0.70

Tested by

no test coverage detected