mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
fix(toast): add position middle
This commit is contained in:
@ -6,7 +6,7 @@ export interface ToastOptions {
|
|||||||
duration?: number;
|
duration?: number;
|
||||||
showCloseButton?: boolean;
|
showCloseButton?: boolean;
|
||||||
closeButtonText?: string;
|
closeButtonText?: string;
|
||||||
position?: 'top' | 'bottom';
|
position?: 'top' | 'bottom' | 'middle';
|
||||||
translucent?: boolean;
|
translucent?: boolean;
|
||||||
enterAnimation?: AnimationBuilder;
|
enterAnimation?: AnimationBuilder;
|
||||||
leaveAnimation?: AnimationBuilder;
|
leaveAnimation?: AnimationBuilder;
|
||||||
|
@ -71,7 +71,7 @@ export class Toast implements OverlayInterface {
|
|||||||
/**
|
/**
|
||||||
* The position of the toast on the screen. Possible values: "top", "middle", "bottom".
|
* The position of the toast on the screen. Possible values: "top", "middle", "bottom".
|
||||||
*/
|
*/
|
||||||
@Prop() position?: 'top' | 'bottom';
|
@Prop() position: 'top' | 'bottom' | 'middle' = 'bottom';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If true, the close button will be displayed. Defaults to `false`.
|
* If true, the close button will be displayed. Defaults to `false`.
|
||||||
@ -190,10 +190,9 @@ export class Toast implements OverlayInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const position = this.position ? this.position : 'bottom';
|
|
||||||
const wrapperClass = {
|
const wrapperClass = {
|
||||||
'toast-wrapper': true,
|
'toast-wrapper': true,
|
||||||
[`toast-${position}`]: true
|
[`toast-${this.position}`]: true
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div class={wrapperClass}>
|
<div class={wrapperClass}>
|
||||||
|
Reference in New Issue
Block a user