mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
docs(modal): include note on using ion-page when wrapping modal component (#22534)
This commit is contained in:
@ -79,6 +79,8 @@ export class ModalPage {
|
||||
}
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using a `<div class="ion-page">` so that the component dimensions are still computed properly.
|
||||
|
||||
### Passing Data
|
||||
|
||||
During creation of a modal, data can be passed in through the `componentProps`.
|
||||
@ -251,6 +253,8 @@ function presentModal() {
|
||||
}
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using a `<div class="ion-page">` so that the component dimensions are still computed properly.
|
||||
|
||||
### Passing Data
|
||||
|
||||
During creation of a modal, data can be passed in through the `componentProps`. The previous example can be written to include data:
|
||||
@ -346,6 +350,8 @@ export const ModalExample: React.FC = () => {
|
||||
};
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using an `<IonPage>` so that the component dimensions are still computed properly.
|
||||
|
||||
### Swipeable Modals
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
@ -467,6 +473,8 @@ export class PageModal {
|
||||
}
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using a `<div class="ion-page">` so that the component dimensions are still computed properly.
|
||||
|
||||
### Passing Data
|
||||
|
||||
During creation of a modal, data can be passed in through the `componentProps`.
|
||||
@ -578,7 +586,6 @@ async presentModal() {
|
||||
|
||||
```html
|
||||
<template>
|
||||
<div>
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>{{ title }}</ion-title>
|
||||
@ -587,7 +594,6 @@ async presentModal() {
|
||||
<ion-content class="ion-padding">
|
||||
{{ content }}
|
||||
</ion-content>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -672,6 +678,8 @@ export default defineComponent({
|
||||
</script>
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using an `<ion-page>` so that the component dimensions are still computed properly.
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
@ -36,6 +36,8 @@ export class ModalPage {
|
||||
}
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using a `<div class="ion-page">` so that the component dimensions are still computed properly.
|
||||
|
||||
### Passing Data
|
||||
|
||||
During creation of a modal, data can be passed in through the `componentProps`.
|
||||
|
@ -31,6 +31,8 @@ function presentModal() {
|
||||
}
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using a `<div class="ion-page">` so that the component dimensions are still computed properly.
|
||||
|
||||
### Passing Data
|
||||
|
||||
During creation of a modal, data can be passed in through the `componentProps`. The previous example can be written to include data:
|
||||
|
@ -17,6 +17,8 @@ export const ModalExample: React.FC = () => {
|
||||
};
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using an `<IonPage>` so that the component dimensions are still computed properly.
|
||||
|
||||
### Swipeable Modals
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
@ -44,6 +44,8 @@ export class PageModal {
|
||||
}
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using a `<div class="ion-page">` so that the component dimensions are still computed properly.
|
||||
|
||||
### Passing Data
|
||||
|
||||
During creation of a modal, data can be passed in through the `componentProps`.
|
||||
|
@ -1,6 +1,5 @@
|
||||
```html
|
||||
<template>
|
||||
<div>
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>{{ title }}</ion-title>
|
||||
@ -9,7 +8,6 @@
|
||||
<ion-content class="ion-padding">
|
||||
{{ content }}
|
||||
</ion-content>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -93,3 +91,5 @@ export default defineComponent({
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
> If you need a wrapper element inside of your modal component, we recommend using an `<ion-page>` so that the component dimensions are still computed properly.
|
||||
|
Reference in New Issue
Block a user