Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IPC-footer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Allen Bai
IPC-footer
Commits
388dc28f
Commit
388dc28f
authored
Feb 22, 2021
by
Allen Bai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: dom的获取支持函数
parent
858dfade
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
index.ts
src/index.ts
+3
-1
No files found.
src/index.ts
View file @
388dc28f
...
@@ -62,7 +62,7 @@ type IPCFooterOptions = {
...
@@ -62,7 +62,7 @@ type IPCFooterOptions = {
/** 自定义域名,默认自动从url取 */
/** 自定义域名,默认自动从url取 */
domain
?:
string
domain
?:
string
/** 要挂载的dom节点,默认为body */
/** 要挂载的dom节点,默认为body */
dom
?:
HTMLElement
|
string
dom
?:
HTMLElement
|
string
|
(()
=>
HTMLElement
)
/** 延迟几秒渲染,默认300毫秒 */
/** 延迟几秒渲染,默认300毫秒 */
delay
?:
number
delay
?:
number
/** 页脚样式 */
/** 页脚样式 */
...
@@ -143,6 +143,8 @@ async function mountIPCFooter(opts: IPCFooterOptions = {}) {
...
@@ -143,6 +143,8 @@ async function mountIPCFooter(opts: IPCFooterOptions = {}) {
targetDom
=
document
.
querySelector
(
'body'
)
targetDom
=
document
.
querySelector
(
'body'
)
}
else
if
(
typeof
opts
.
dom
===
'string'
)
{
}
else
if
(
typeof
opts
.
dom
===
'string'
)
{
targetDom
=
document
.
querySelector
(
opts
.
dom
)
targetDom
=
document
.
querySelector
(
opts
.
dom
)
}
else
if
(
typeof
opts
.
dom
===
'function'
)
{
targetDom
=
opts
.
dom
()
}
else
{
}
else
{
targetDom
=
opts
.
dom
targetDom
=
opts
.
dom
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment