-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transition): fix transition not work
- Loading branch information
Showing
8 changed files
with
78 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; | ||
export const Loading = createAsyncComponent(() => import('./src/index.vue')); | ||
// import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; | ||
// export const Loading = createAsyncComponent(() => import('./src/index.vue')); | ||
|
||
import Loading from './src/index.vue'; | ||
|
||
export { Loading }; | ||
export { useLoading } from './src/useLoading'; | ||
export { createLoading } from './src/createLoading'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ export function useTable( | |
}, | ||
{ | ||
immediate: true, | ||
deep: true, | ||
} | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { FunctionalComponent } from 'vue'; | ||
import type { RouteLocation } from 'vue-router'; | ||
|
||
export interface DefaultContext { | ||
Component: FunctionalComponent & { type: Indexable }; | ||
route: RouteLocation; | ||
} | ||
|
||
export function getTransitionName({ | ||
route, | ||
openCache, | ||
cacheTabs, | ||
enableTransition, | ||
def, | ||
}: Pick<DefaultContext, 'route'> & { | ||
enableTransition: boolean; | ||
openCache: boolean; | ||
def: string; | ||
cacheTabs: string[]; | ||
}) { | ||
const isInCache = cacheTabs.includes(route.name as string); | ||
const transitionName = 'fade-slide'; | ||
let name: string | null = transitionName; | ||
|
||
if (openCache) { | ||
name = isInCache && route.meta.loaded && enableTransition ? transitionName : null; | ||
} | ||
return name || route.meta.transitionName || def; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters