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 ? ( <>