Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-15 17:00:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ce081f6a53a4cddd1856bd94f076bf79cd3f3e45
ce081f6a
1 parent
290ffa4f
fix
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
src/composables/useUnwatchList.js
src/views/me/followList.vue
src/views/me/unwatchList.vue
src/composables/useUnwatchList.js
View file @
ce081f6
...
...
@@ -13,6 +13,10 @@ export const useUnwatchList = () => {
const
loading
=
ref
(
false
);
const
finished
=
ref
(
false
);
// 因为不能让空图标提前出来的写法
const
finishedTextStatus
=
ref
(
false
);
const
emptyStatus
=
ref
(
false
);
/**
* 向下滚动查询数据
*/
...
...
@@ -38,6 +42,11 @@ export const useUnwatchList = () => {
// 加载状态结束
finished
.
value
=
true
;
}
// 空数据提示
if
(
!
prod_list
.
value
.
length
)
{
finishedTextStatus
.
value
=
false
;
emptyStatus
.
value
=
true
;
}
}
else
{
// tslint:disable-next-line: no-console
console
.
warn
(
res
);
...
...
@@ -58,6 +67,8 @@ export const useUnwatchList = () => {
onLoad
,
prod_list
,
finished
,
loading
loading
,
finishedTextStatus
,
emptyStatus
,
}
}
...
...
src/views/me/followList.vue
View file @
ce081f6
...
...
@@ -45,7 +45,7 @@ axios.get('/srv/?a=my_follow')
.then(res => {
if (res.data.code === 1) {
followList.value = res.data.data;
if (!res.data.data.
value.
length) {
if (!res.data.data.length) {
emptyStatus.value = true;
}
} else {
...
...
src/views/me/unwatchList.vue
View file @
ce081f6
...
...
@@ -11,7 +11,7 @@
<van-empty v-if="emptyStatus"
class="custom-image"
:image="no_image"
description="暂无
关注
"
description="暂无
未看
"
/>
</div>
</template>
...
...
@@ -33,7 +33,7 @@ import { wxInfo } from '@/utils/tools';
const $router = useRouter();
const { onLoad, prod_list, finished, loading } = useUnwatchList();
const { onLoad, prod_list, finished, loading
, finishedTextStatus, emptyStatus
} = useUnwatchList();
/****************** keepAlive 模块 *******************/
...
...
@@ -91,13 +91,6 @@ onBeforeRouteLeave((to, from) => {
/*********************************************************/
// 因为不能让空图标提前出来的写法
const finishedTextStatus = ref(false);
const emptyStatus = ref(false);
if (!prod_list.value.length) {
finishedTextStatus.value = false;
emptyStatus.value = true;
}
</script>
<script>
...
...
Please
register
or
login
to post a comment