Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
26d9476c
Commit
26d9476c
authored
Jul 30, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(use-loading): add `setTip` method
为useLoading添加setTip方法
parent
ddd1893b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
useLoading.ts
src/components/Loading/src/useLoading.ts
+10
-4
No files found.
CHANGELOG.zh_CN.md
View file @
26d9476c
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
-
**Preview**
添加新的属性及事件
-
**Preview**
添加新的属性及事件
-
**Dark Theme**
新增对 tailwindcss 夜间模式的支持
-
**Dark Theme**
新增对 tailwindcss 夜间模式的支持
-
**其它**
为 useLoading 添加 setTip 方法
### 🐛 Bug Fixes
### 🐛 Bug Fixes
...
...
src/components/Loading/src/useLoading.ts
View file @
26d9476c
...
@@ -12,10 +12,12 @@ interface Fn {
...
@@ -12,10 +12,12 @@ interface Fn {
():
void
;
():
void
;
}
}
export
function
useLoading
(
props
:
Partial
<
LoadingProps
>
):
[
Fn
,
Fn
];
export
function
useLoading
(
props
:
Partial
<
LoadingProps
>
):
[
Fn
,
Fn
,
(
string
)
=>
void
];
export
function
useLoading
(
opt
:
Partial
<
UseLoadingOptions
>
):
[
Fn
,
Fn
];
export
function
useLoading
(
opt
:
Partial
<
UseLoadingOptions
>
):
[
Fn
,
Fn
,
(
string
)
=>
void
];
export
function
useLoading
(
opt
:
Partial
<
LoadingProps
>
|
Partial
<
UseLoadingOptions
>
):
[
Fn
,
Fn
]
{
export
function
useLoading
(
opt
:
Partial
<
LoadingProps
>
|
Partial
<
UseLoadingOptions
>
):
[
Fn
,
Fn
,
(
string
)
=>
void
]
{
let
props
:
Partial
<
LoadingProps
>
;
let
props
:
Partial
<
LoadingProps
>
;
let
target
:
HTMLElement
|
Ref
<
ElRef
>
=
document
.
body
;
let
target
:
HTMLElement
|
Ref
<
ElRef
>
=
document
.
body
;
...
@@ -39,5 +41,9 @@ export function useLoading(opt: Partial<LoadingProps> | Partial<UseLoadingOption
...
@@ -39,5 +41,9 @@ export function useLoading(opt: Partial<LoadingProps> | Partial<UseLoadingOption
instance
.
close
();
instance
.
close
();
};
};
return
[
open
,
close
];
const
setTip
=
(
tip
:
string
)
=>
{
instance
.
setTip
(
tip
);
};
return
[
open
,
close
,
setTip
];
}
}
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