From 4cc470c2c9ce646c0a93f89a036eeb69edfe4346 Mon Sep 17 00:00:00 2001 From: 63f1bb74d2451104dc7d8b9f <63f1bb74d2451104dc7d8b9f@devide> Date: Sat, 1 Jul 2023 18:41:00 +0000 Subject: [PATCH] Sat Jul 1 18:41:00 UTC 2023 inscode --- index.html | 2 +- src/components/SearchGrade.vue | 27 ++++++++++++++++----------- src/components/const.js | 4 ++++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index faecc24..34993e9 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - csdn 用户查分 + csdn 用户快捷查分该文章
diff --git a/src/components/SearchGrade.vue b/src/components/SearchGrade.vue index ef3c1c5..34e4fd2 100644 --- a/src/components/SearchGrade.vue +++ b/src/components/SearchGrade.vue @@ -184,17 +184,17 @@ function initFirstData() { }); onMounted(() => { - // const storageUid = window.localStorage.getItem('csdnUid') - // console.log('window.localStorage', window.localStorage) - // console.log('storageUid', storageUid) - // if (storageUid) { - // state.searchValue = storageUid - // onSearch() - // } - // storage - if (state.dataSource) { - initFirstData(); + const storageUid = localStorage.getItem('csdnUid') + console.log('window.localStorage', localStorage) + console.log('storageUid', storageUid) + if (storageUid) { + state.searchValue = storageUid + onSearch() } + // storage + // if (state.dataSource) { + // initFirstData(); + // } }) onUnmounted(() => { @@ -220,7 +220,7 @@ function initFirstData() { + diff --git a/src/components/const.js b/src/components/const.js index cc0cb42..9c2aec9 100644 --- a/src/components/const.js +++ b/src/components/const.js @@ -31,4 +31,8 @@ export const tableColumns= [{ }, { title: '发文时间', dataIndex: 'postTime', + sorter: (a, b) => new Date(a.postTime) - new Date(b.postTime), + }, { + title: '操作', + key: 'option', }] \ No newline at end of file -- GitLab