From 0dd415c2f358b9b09295f774627afd43b09a5666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=B5=E8=B6=85?= <王念超@163.com> Date: Tue, 11 Jun 2024 18:51:08 +0800 Subject: [PATCH] save --- js_node/test.cjs | 7 +++++++ src/pages/pc/components/BaseTable.vue | 13 +++++++++---- src/pages/pc/word/EditWordDict.vue | 6 +++--- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 js_node/test.cjs diff --git a/js_node/test.cjs b/js_node/test.cjs new file mode 100644 index 00000000..66ed1d19 --- /dev/null +++ b/js_node/test.cjs @@ -0,0 +1,7 @@ +let path = require("path"); +let fs = require("fs"); +const axios = require('axios') + +let str = fs.readFileSync('./save/allNew.min.json', "utf8"); + +console.log('str',JSON.parse(str)[0]) \ No newline at end of file diff --git a/src/pages/pc/components/BaseTable.vue b/src/pages/pc/components/BaseTable.vue index 66c53613..1d62a63d 100644 --- a/src/pages/pc/components/BaseTable.vue +++ b/src/pages/pc/components/BaseTable.vue @@ -36,7 +36,7 @@ const emit = defineEmits<{ }>() const settingStore = useSettingStore() -const listRef: any = $ref() +let listRef: any = $ref() function scrollToBottom() { nextTick(() => { @@ -44,13 +44,18 @@ function scrollToBottom() { }) } +function scrollToTop() { + nextTick(() => { + listRef?.scrollTo(0, 0) + }) +} + function scrollToItem(index: number) { nextTick(() => { listRef?.children[index]?.scrollIntoView({block: 'center', behavior: 'smooth'}) }) } - defineExpose({scrollToBottom, scrollToItem}) let pageNo = $ref(1) @@ -106,7 +111,7 @@ function handleBatchDel() { function handlePageNo(e) { pageNo = e - console.log('listRef', listRef) + scrollToTop() } const s = useSlots() @@ -202,7 +207,7 @@ defineRender( : currentList.length ? ( <>