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
8fd1994b
Commit
8fd1994b
authored
Oct 19, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: bump 2.0.0-rc.3
parent
2f12556d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
7 deletions
+61
-7
CHANGELOG.en_US.md
CHANGELOG.en_US.md
+23
-0
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+24
-0
package.json
package.json
+1
-1
useWindowSize.ts
src/hooks/event/useWindowSize.ts
+13
-6
No files found.
CHANGELOG.en_US.md
View file @
8fd1994b
# 2.0.0-rc.3 (2020-10-19)
### ✨ Features
-
Added excel component and excel/xml/csv/html export example
-
Added excel import example
-
Added global error handling
-
Added markdown components and examples
-
The menu name can be displayed when adding a new folding menu
### Docs
-
add project doc
### 🎫 Chores
-
update deps
### 🐛 Bug Fixes
-
Fix the adaptive problem of the top menu
-
Fix window system packaging error
# 2.0.0-rc.2 (2020-10-17)
### ✨ Features
...
...
CHANGELOG.zh_CN.md
View file @
8fd1994b
# 2.0.0-rc.3 (2020-10-19)
### ✨ Features
-
新增 excel 组件及 excel/xml/csv/html 导出示例
-
新增 excel 导入示例
-
新增全局错误处理
-
新增 markdown 组件及示例
-
新增折叠菜单时可显示菜单名
### Docs
-
添加项目文档
### 🎫 Chores
-
升级依赖
-
其他细节优化
### 🐛 Bug Fixes
-
修复顶部菜单自适应问题
-
修复 window 系统打包报错问题
# 2.0.0-rc.2 (2020-10-17)
### ✨ Features
...
...
package.json
View file @
8fd1994b
{
"name"
:
"vben-admin-2.0"
,
"version"
:
"2.0.0-rc.
2
"
,
"version"
:
"2.0.0-rc.
3
"
,
"scripts"
:
{
"bootstrap"
:
"yarn install"
,
"serve"
:
"cross-env ts-node --files -P ./build/tsconfig.json ./build/script/preserve && cross-env NODE_ENV=development vite"
,
...
...
src/hooks/event/useWindowSize.ts
View file @
8fd1994b
...
...
@@ -4,7 +4,6 @@ import { tryOnMounted, tryOnUnmounted } from '/@/utils/helper/vueHelper';
import
{
ref
}
from
'
vue
'
;
import
{
useDebounce
}
from
'
/@/hooks/core/useDebounce
'
;
import
{
CancelFn
}
from
'
../core/types
'
;
interface
WindowSizeOptions
{
once
?:
boolean
;
...
...
@@ -12,25 +11,33 @@ interface WindowSizeOptions {
listenerOptions
?:
AddEventListenerOptions
|
boolean
;
}
export
function
useWindowSizeFn
<
T
>
(
fn
:
Fn
<
T
>
,
wait
=
150
,
options
?:
WindowSizeOptions
)
:
CancelFn
{
export
function
useWindowSizeFn
<
T
>
(
fn
:
Fn
<
T
>
,
wait
=
150
,
options
?:
WindowSizeOptions
)
{
let
handler
=
()
=>
{
fn
();
};
const
[
handleSize
,
cancel
]
=
useDebounce
(
handler
,
wait
,
options
);
handler
=
handleSize
;
tryOnMounted
(
()
=>
{
const
start
=
()
=>
{
if
(
options
&&
options
.
immediate
)
{
handler
();
}
window
.
addEventListener
(
'
resize
'
,
handler
);
}
)
;
};
tryOnUnmounted
(
()
=>
{
const
stop
=
()
=>
{
window
.
removeEventListener
(
'
resize
'
,
handler
);
cancel
();
};
tryOnMounted
(()
=>
{
start
();
});
tryOnUnmounted
(()
=>
{
stop
();
});
return
cancel
;
return
[
start
,
stop
]
;
}
export
const
useWindowSize
=
(
wait
=
150
,
options
?:
WindowSizeOptions
)
=>
{
...
...
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