mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
refactor(all): update to one (part 3) (#18874)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Build, Component, ComponentInterface, Element, Event, EventEmitter, Listen, Method, Prop, State, Watch, h } from '@stencil/core';
|
||||
import { Build, Component, ComponentInterface, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
@ -497,37 +497,36 @@ export class Menu implements ComponentInterface, MenuI {
|
||||
this.afterAnimation(false);
|
||||
}
|
||||
|
||||
hostData() {
|
||||
const { isEndSide, type, disabled, isPaneVisible } = this;
|
||||
return {
|
||||
role: 'navigation',
|
||||
class: {
|
||||
[`${this.mode}`]: true,
|
||||
[`menu-type-${type}`]: true,
|
||||
'menu-enabled': !disabled,
|
||||
'menu-side-end': isEndSide,
|
||||
'menu-side-start': !isEndSide,
|
||||
'menu-pane-visible': isPaneVisible
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
return [
|
||||
<div
|
||||
class="menu-inner"
|
||||
ref={el => this.menuInnerEl = el}
|
||||
const { isEndSide, type, disabled, mode, isPaneVisible } = this;
|
||||
|
||||
return (
|
||||
<Host
|
||||
role="navigation"
|
||||
class={{
|
||||
[mode]: true,
|
||||
[`menu-type-${type}`]: true,
|
||||
'menu-enabled': !disabled,
|
||||
'menu-side-end': isEndSide,
|
||||
'menu-side-start': !isEndSide,
|
||||
'menu-pane-visible': isPaneVisible
|
||||
}}
|
||||
>
|
||||
<slot></slot>
|
||||
</div>,
|
||||
|
||||
<ion-backdrop
|
||||
ref={el => this.backdropEl = el}
|
||||
class="menu-backdrop"
|
||||
tappable={false}
|
||||
stopPropagation={false}
|
||||
/>
|
||||
];
|
||||
<div
|
||||
class="menu-inner"
|
||||
ref={el => this.menuInnerEl = el}
|
||||
>
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
||||
<ion-backdrop
|
||||
ref={el => this.backdropEl = el}
|
||||
class="menu-backdrop"
|
||||
tappable={false}
|
||||
stopPropagation={false}
|
||||
/>
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user