Commit 0c173db7 by 匡雅琴

解决onload页面一进去就加载的问题

1 parent ba0532c5
......@@ -54,6 +54,7 @@
v-model:loading="loading"
:finished="finished"
@load="onLoad"
:immediate-check="false"
>
<!-- 没有历史数据 -->
<template v-if="!list.length">
......@@ -120,13 +121,16 @@ type UserInfo = {
plateNo?: string;
authStatus?: number;
};
interface page {
pageNum: number;
pageSize: number;
}
const userStore = useUserStore();
const router = useRouter();
const data: {
innerHeight: number;
userInfo: UserInfo;
list: listStyle;
} = reactive({
innerHeight: window.innerHeight, // 获取可视区高度
userInfo: {
......@@ -141,7 +145,7 @@ const list = reactive<listStyle>([]);
const loading = ref<boolean>(true);
const finished = ref<boolean>(false);
// 分页加载数据
let pageData: object = {
let pageData: page = {
pageNum: 0,
pageSize: 10,
};
......@@ -205,7 +209,7 @@ const onLoad = async () => {
// 组件挂载完成
onBeforeMount(() => {
hasSession();
// onLoad();
onLoad();
});
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!