mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
fix(vue): use direction type from core (#17901)
This commit is contained in:

committed by
Mike Hartington

parent
d87170db3a
commit
fa1317359a
@ -1,4 +1,5 @@
|
||||
import Vue, { CreateElement, RenderContext, VNodeData } from 'vue';
|
||||
import { NavDirection } from '@ionic/core';
|
||||
|
||||
type TransitionDone = () => void;
|
||||
interface Props {
|
||||
@ -69,7 +70,7 @@ function catchIonicGoBack(parent: Vue, event: Event): void {
|
||||
let defaultHref: string;
|
||||
|
||||
// Explicitly override router direction to always trigger a back transition
|
||||
$router.directionOverride = -1;
|
||||
$router.directionOverride = 'back';
|
||||
|
||||
// If we can go back - do so
|
||||
if ($router.canGoBack()) {
|
||||
@ -127,8 +128,8 @@ function transition(parent: Vue, props: Props, leavingEl: HTMLElement) {
|
||||
return ionRouterOutlet.componentOnReady().then((el: HTMLIonRouterOutletElement) => {
|
||||
return el.commit(enteringEl, leavingEl, {
|
||||
deepWait: true,
|
||||
duration: !props.animated ? 0 : undefined,
|
||||
direction: parent.$router.direction === 1 ? 'forward' : 'back',
|
||||
duration: !props.animated || parent.$router.direction === 'root' ? 0 : undefined,
|
||||
direction: parent.$router.direction as NavDirection,
|
||||
showGoBack: parent.$router.canGoBack(),
|
||||
});
|
||||
}).catch(console.error);
|
||||
|
Reference in New Issue
Block a user