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
8f9eff78
Commit
8f9eff78
authored
Dec 11, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: update back-top style
parent
dddda5b2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
19 deletions
+39
-19
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+4
-0
index.ts
src/components/ClickOutSide/index.ts
+3
-3
index.less
src/design/ant/index.less
+5
-0
index.ts
src/router/index.ts
+1
-1
scrollBehavior.ts
src/router/scrollBehavior.ts
+0
-0
createAsyncComponent.tsx
src/utils/factory/createAsyncComponent.tsx
+26
-15
No files found.
CHANGELOG.zh_CN.md
View file @
8f9eff78
...
...
@@ -4,6 +4,10 @@
-
移除左侧菜单搜索,新增顶部菜单搜索功能
### 🎫 Chores
-
返回顶部样式调整,避免遮住其他元素
## 2.0.0-rc.13 (2020-12-10)
## (破坏性更新) Breaking changes
...
...
src/components/ClickOutSide/index.ts
View file @
8f9eff78
import
ClickOutSide
from
'
./src/index.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
createAsyncComponent
}
from
'
/@/utils/factory/createAsyncComponent
'
;
withInstall
(
ClickOutSide
);
export
const
ClickOutSide
=
createAsyncComponent
(()
=>
import
(
'
./src/index.vue
'
)
);
export
{
ClickOutSide
}
;
withInstall
(
ClickOutSide
)
;
src/design/ant/index.less
View file @
8f9eff78
...
...
@@ -7,6 +7,11 @@
width: 100%;
}
.ant-back-top {
right: 20px;
bottom: 20px;
}
.collapse-container__body {
> .ant-descriptions {
margin-left: 6px;
...
...
src/router/index.ts
View file @
8f9eff78
...
...
@@ -6,7 +6,7 @@ import { createRouter, createWebHashHistory } from 'vue-router';
import
{
createGuard
}
from
'
./guard/
'
;
import
{
basicRoutes
}
from
'
./routes/
'
;
import
{
scrollBehavior
}
from
'
./scrollBehavio
u
r
'
;
import
{
scrollBehavior
}
from
'
./scrollBehavior
'
;
export
const
hashRouter
=
createWebHashHistory
();
...
...
src/router/scrollBehavio
u
r.ts
→
src/router/scrollBehavior.ts
View file @
8f9eff78
File moved
src/utils/factory/createAsyncComponent.tsx
View file @
8f9eff78
import
{
defineAsyncComponent
}
from
'
vue
'
;
import
{
Spin
}
from
'
ant-design-vue
'
;
import
{
noop
}
from
'
/@/utils/index
'
;
interface
Options
{
size
?:
'
default
'
|
'
small
'
|
'
large
'
;
delay
?:
number
;
timeout
?:
number
;
loading
?:
boolean
;
retry
?:
boolean
;
}
export
function
createAsyncComponent
(
loader
:
any
)
{
export
function
createAsyncComponent
(
loader
:
Fn
,
options
:
Options
=
{})
{
const
{
size
=
'
small
'
,
delay
=
100
,
timeout
=
3000
,
loading
=
true
,
retry
=
true
}
=
options
;
return
defineAsyncComponent
({
loader
:
loader
,
loadingComponent
:
<
Spin
spinning=
{
true
}
/>
,
loader
,
loadingComponent
:
loading
?
<
Spin
spinning=
{
true
}
size=
{
size
}
/>
:
undefined
,
// The error component will be displayed if a timeout is
// provided and exceeded. Default: Infinity.
timeout
:
3000
,
timeout
,
// Defining if component is suspensible. Default: true.
// suspensible: false,
delay
:
100
,
delay
,
/**
*
* @param {*} error Error message object
...
...
@@ -18,7 +27,9 @@ export function createAsyncComponent(loader: any) {
* @param {*} fail End of failure
* @param {*} attempts Maximum allowed retries number
*/
onError
(
error
,
retry
,
fail
,
attempts
)
{
onError
:
!
retry
?
noop
:
(
error
,
retry
,
fail
,
attempts
)
=>
{
if
(
error
.
message
.
match
(
/fetch/
)
&&
attempts
<=
3
)
{
// retry on fetch errors, 3 max attempts
retry
();
...
...
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