256256 link
257257 small
258258 @click =" getDirSize(row, $index)"
259- :loading =" btnLoading == $index "
259+ :loading =" row. btnLoading"
260260 >
261261 <span v-if =" row.dirSize == undefined" >
262262 {{ $t('file.calculate') }}
@@ -377,7 +377,6 @@ const initData = () => ({
377377});
378378let req = reactive (initData ());
379379let loading = ref (false );
380- let btnLoading = ref (- 1 );
381380const paths = ref <FilePaths []>([]);
382381let pathWidth = ref (0 );
383382const history: string [] = [];
@@ -419,7 +418,6 @@ const dialogVscodeOpenRef = ref();
419418const previewRef = ref ();
420419const processRef = ref ();
421420
422- // editablePath
423421const { searchableStatus, searchablePath, searchableInputRef, searchableInputBlur } = useSearchable (paths );
424422
425423const paginationConfig = reactive ({
@@ -453,7 +451,6 @@ const search = async () => {
453451 });
454452};
455453
456- /** just search, no handleSearchResult */
457454const searchFile = async () => {
458455 loading .value = true ;
459456 try {
@@ -548,7 +545,6 @@ const jump = async (url: string) => {
548545 const { path : oldUrl, pageSize : oldPageSize } = req ;
549546 Object .assign (req , initData (), { path: url , containSub: false , search: ' ' , pageSize: oldPageSize });
550547 let searchResult = await searchFile ();
551- // check search result,the file is exists?
552548 if (! searchResult .data .path ) {
553549 req .path = oldUrl ;
554550 globalStore .setLastFilePath (req .path );
@@ -566,7 +562,6 @@ const jump = async (url: string) => {
566562
567563const backForwardJump = async (url : string ) => {
568564 const oldPageSize = req .pageSize ;
569- // reset search params before exec jump
570565 Object .assign (req , initData ());
571566 req .path = url ;
572567 req .containSub = false ;
@@ -624,15 +619,15 @@ const getDirSize = async (row: any, index: number) => {
624619 const req = {
625620 path: row .path ,
626621 };
627- btnLoading .value = index ;
622+ data .value [ index ]. btnLoading = true ;
628623 await computeDirSize (req )
629624 .then (async (res ) => {
630625 let newData = [... data .value ];
631626 newData [index ].dirSize = res .data .size ;
632627 data .value = newData ;
633628 })
634629 .finally (() => {
635- btnLoading .value = - 1 ;
630+ data .value [ index ]. btnLoading = false ;
636631 });
637632};
638633
0 commit comments