Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
vite-integral
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0c173db7
authored
Aug 11, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决onload页面一进去就加载的问题
1 parent
ba0532c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
src/views/home/index.vue
src/views/home/index.vue
View file @
0c173db
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
v-model:loading=
"loading"
v-model:loading=
"loading"
:finished=
"finished"
:finished=
"finished"
@
load=
"onLoad"
@
load=
"onLoad"
:immediate-check=
"false"
>
>
<!-- 没有历史数据 -->
<!-- 没有历史数据 -->
<template
v-if=
"!list.length"
>
<template
v-if=
"!list.length"
>
...
@@ -120,13 +121,16 @@ type UserInfo = {
...
@@ -120,13 +121,16 @@ type UserInfo = {
plateNo
?:
string
;
plateNo
?:
string
;
authStatus
?:
number
;
authStatus
?:
number
;
};
};
interface
page
{
pageNum
:
number
;
pageSize
:
number
;
}
const
userStore
=
useUserStore
();
const
userStore
=
useUserStore
();
const
router
=
useRouter
();
const
router
=
useRouter
();
const
data
:
{
const
data
:
{
innerHeight
:
number
;
innerHeight
:
number
;
userInfo
:
UserInfo
;
userInfo
:
UserInfo
;
list
:
listStyle
;
}
=
reactive
({
}
=
reactive
({
innerHeight
:
window
.
innerHeight
,
// 获取可视区高度
innerHeight
:
window
.
innerHeight
,
// 获取可视区高度
userInfo
:
{
userInfo
:
{
...
@@ -141,7 +145,7 @@ const list = reactive<listStyle>([]);
...
@@ -141,7 +145,7 @@ const list = reactive<listStyle>([]);
const
loading
=
ref
<
boolean
>
(
true
);
const
loading
=
ref
<
boolean
>
(
true
);
const
finished
=
ref
<
boolean
>
(
false
);
const
finished
=
ref
<
boolean
>
(
false
);
// 分页加载数据
// 分页加载数据
let
pageData
:
object
=
{
let
pageData
:
page
=
{
pageNum
:
0
,
pageNum
:
0
,
pageSize
:
10
,
pageSize
:
10
,
};
};
...
@@ -205,7 +209,7 @@ const onLoad = async () => {
...
@@ -205,7 +209,7 @@ const onLoad = async () => {
// 组件挂载完成
// 组件挂载完成
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{
hasSession
();
hasSession
();
//
onLoad();
onLoad
();
});
});
</
script
>
</
script
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment