@@ -289,6 +289,15 @@ const addFn = (v: RedisKeyType) => {
289
289
break
290
290
}
291
291
}
292
+ const refreshFn = (s : boolean ) => {
293
+ if (s ) {
294
+ search .tree = []
295
+ } else {
296
+ original .tree = []
297
+ }
298
+ console .log (' refreshFn' ,s , original )
299
+ queryData (s )
300
+ }
292
301
</script >
293
302
<template >
294
303
<div ref =" treeBoxRef" class =" w-full flex flex-col flex-1 justify-start items-start" >
@@ -321,28 +330,40 @@ const addFn = (v: RedisKeyType) => {
321
330
virtual-scroll
322
331
expand-on-click
323
332
:node-props =" nodeProps"
324
- :style =" { height: height+ 'px' }"
333
+ :style =" { height: height + 'px' }"
325
334
key-field =" id"
326
335
children-field =" children"
327
336
class =" whitespace-nowrap"
328
337
/>
329
- <div
330
- class =" flex flex-1 w-full justify-center items-center"
331
- v-if =" !search.match"
332
- >
333
- <n-button v-show =" original.cursor !== '0'" size =" small" type =" primary" :loading =" reqStore.reqLoading" @click =" loadMoreFn"
338
+ <div class =" flex flex-1 w-full justify-center items-center" v-if =" !search.match" >
339
+ <n-button
340
+ v-show =" original.cursor !== '0'"
341
+ size =" small"
342
+ type =" primary"
343
+ :loading =" reqStore.reqLoading"
344
+ @click =" loadMoreFn"
334
345
>加载更多
335
346
</n-button >
336
- <n-button v-show =" original.cursor === '0'" size =" small" type =" primary" >更新数据</n-button >
347
+ <n-button
348
+ @click =" refreshFn(false)"
349
+ v-show =" original.cursor === '0'"
350
+ size =" small"
351
+ type =" primary"
352
+ >更新数据
353
+ </n-button >
337
354
</div >
338
- <div
339
- v-else
340
- class =" flex flex-1 w-full justify-center items-center"
341
- >
342
- <n-button v-show =" search.cursor !== '0'" size =" small" type =" primary" :loading =" reqStore.reqLoading" @click =" loadMoreFn"
355
+ <div v-else class =" flex flex-1 w-full justify-center items-center" >
356
+ <n-button
357
+ v-show =" search.cursor !== '0'"
358
+ size =" small"
359
+ type =" primary"
360
+ :loading =" reqStore.reqLoading"
361
+ @click =" loadMoreFn"
343
362
>加载更多
344
363
</n-button >
345
- <n-button v-show =" search.cursor === '0'" size =" small" type =" primary" >更新数据</n-button >
364
+ <n-button @click =" refreshFn(true)" v-show =" search.cursor === '0'" size =" small" type =" primary"
365
+ >更新数据</n-button
366
+ >
346
367
</div >
347
368
</div >
348
369
<n-dropdown
0 commit comments