mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
fix(vue): modal, popover, and nav are now created within application context (#22282)
resolves #22079
This commit is contained in:
47
packages/vue/test-app/src/components/NavRoot.vue
Normal file
47
packages/vue/test-app/src/components/NavRoot.vue
Normal file
@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons>
|
||||
<ion-button @click="dismiss">Dismiss</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Nav - Root</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content class="ion-padding">
|
||||
<ion-button expand="block" @click="pushPage" id="push-nav-child">Go to Nav Child</ion-button>
|
||||
</ion-content>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {
|
||||
IonButtons,
|
||||
IonButton,
|
||||
IonContent,
|
||||
IonHeader,
|
||||
IonTitle,
|
||||
IonToolbar,
|
||||
modalController
|
||||
} from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
import NavChild from '@/components/NavChild.vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonButtons,
|
||||
IonButton,
|
||||
IonContent,
|
||||
IonHeader,
|
||||
IonTitle,
|
||||
IonToolbar
|
||||
},
|
||||
methods: {
|
||||
pushPage: function() {
|
||||
const ionNav = document.querySelector('ion-nav') as any;
|
||||
ionNav.push(NavChild, { title: 'Custom Title' });
|
||||
},
|
||||
dismiss: async function() {
|
||||
await modalController.dismiss();
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user