From 7011c8440204fd7ed7f1e779f7e91695ae34d47c Mon Sep 17 00:00:00 2001 From: greenhat616 Date: Fri, 1 Sep 2023 09:43:04 +0800 Subject: [PATCH] feat: use masonry css instead of js version --- components/FetchStatusWarpper.vue | 33 +++++++++++++++ package.json | 1 - pages/dashboard/do_review.vue | 59 ++++++++++++-------------- pages/dashboard/records/review.vue | 67 +++++++++++++----------------- plugins/vueMasonry.client.ts | 5 --- pnpm-lock.yaml | 62 --------------------------- 6 files changed, 90 insertions(+), 137 deletions(-) create mode 100644 components/FetchStatusWarpper.vue delete mode 100644 plugins/vueMasonry.client.ts diff --git a/components/FetchStatusWarpper.vue b/components/FetchStatusWarpper.vue new file mode 100644 index 0000000..c3534fe --- /dev/null +++ b/components/FetchStatusWarpper.vue @@ -0,0 +1,33 @@ + + + + diff --git a/package.json b/package.json index 0f33f40..0c63068 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,6 @@ "vant": "^4.6.6", "vite": "^4.4.9", "vue-echarts": "^6.6.1", - "vue-masonry": "^0.16.0", "vue-next-masonry": "^1.1.3", "xss": "^1.0.14" }, diff --git a/pages/dashboard/do_review.vue b/pages/dashboard/do_review.vue index 136759b..62f8323 100644 --- a/pages/dashboard/do_review.vue +++ b/pages/dashboard/do_review.vue @@ -8,12 +8,12 @@ useHead({ title: '句子审核' }) // TODO: 临时修复 Masonry 路由切换后绘制错误的问题 -const redrawVueMasonry = inject<(id: string) => void>('redrawVueMasonry') -const redrawMasonary = () => redrawVueMasonry && redrawVueMasonry('32') -onMounted(() => { - if (!redrawVueMasonry) return - setTimeout(redrawMasonary, 600) -}) +// const redrawVueMasonry = inject<(id: string) => void>('redrawVueMasonry') +// const redrawMasonary = () => redrawVueMasonry && redrawVueMasonry('32') +// onMounted(() => { +// if (!redrawVueMasonry) return +// setTimeout(redrawMasonary, 600) +// }) const route = useRoute() @@ -198,7 +198,7 @@ const refreshPollItem = async (index: number, pollID: number) => { else message.error(`刷新投票 ${pollID} 失败,投票数据为空。请刷新页面后重试。`) - nextTick(redrawMasonary) + // nextTick(redrawMasonary) } const onOperationDone = (event: 'submit' | 'cancel', index: number) => { // console.log(event, index) @@ -259,40 +259,35 @@ const onOperationDone = (event: 'submit' | 'cancel', index: number) => {
- -
- -
-
- -
- -
+ + + +