mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
fix(): update to Stencil One 🎉🎊
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { Component, ComponentInterface } from '@stencil/core';
|
||||
|
||||
import { Mode } from '../../interface';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-buttons',
|
||||
@ -11,12 +11,12 @@ import { Mode } from '../../interface';
|
||||
scoped: true,
|
||||
})
|
||||
export class Buttons implements ComponentInterface {
|
||||
mode!: Mode;
|
||||
|
||||
hostData() {
|
||||
const mode = getIonMode(this);
|
||||
return {
|
||||
class: {
|
||||
[`${this.mode}`]: true
|
||||
[`${mode}`]: true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -107,14 +107,22 @@ The `<ion-buttons>` element can be positioned inside of the toolbar using a name
|
||||
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import {
|
||||
IonButtons,
|
||||
IonToolbar,
|
||||
IonBackButton,
|
||||
IonTitle,
|
||||
IonButton,
|
||||
IonIcon,
|
||||
IonMenuButton,
|
||||
IonContent
|
||||
} from '@ionic/react';
|
||||
|
||||
import { IonButtons, IonToolbar, IonBackButton, IonTitle, IonButton, IonIcon, IonMenuButton } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<>
|
||||
export const ButtonsExample: React.FunctionComponent = () => (
|
||||
<IonContent>
|
||||
<IonToolbar>
|
||||
<IonButtons slot="start">
|
||||
<IonBackButton goBack={() => {}} />
|
||||
<IonBackButton defaultHref="/" />
|
||||
</IonButtons>
|
||||
<IonTitle>Back Button</IonTitle>
|
||||
</IonToolbar>
|
||||
@ -124,13 +132,13 @@ const Example: React.SFC<{}> = () => (
|
||||
<IonButton>
|
||||
<IonIcon slot="icon-only" name="contact" />
|
||||
</IonButton>
|
||||
<IonButton> />
|
||||
<IonButton>
|
||||
<IonIcon slot="icon-only" name="search" />
|
||||
</IonButton>
|
||||
</IonButtons>
|
||||
<IonTitle>Default Buttons</IonTitle>
|
||||
<IonButtons slot="primary">
|
||||
<IonButton color="secondary"> />
|
||||
<IonButton color="secondary">
|
||||
<IonIcon slot="icon-only" name="more" />
|
||||
</IonButton>
|
||||
</IonButtons>
|
||||
@ -147,10 +155,9 @@ const Example: React.SFC<{}> = () => (
|
||||
<IonMenuButton autoHide={false} />
|
||||
</IonButtons>
|
||||
</IonToolbar>
|
||||
</>
|
||||
</IonContent>
|
||||
);
|
||||
|
||||
export default Example;
|
||||
```
|
||||
|
||||
|
||||
### Vue
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script src="../../../../../dist/ionic.js"></script>
|
||||
</head>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script></head>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
|
||||
@ -1,13 +1,21 @@
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import {
|
||||
IonButtons,
|
||||
IonToolbar,
|
||||
IonBackButton,
|
||||
IonTitle,
|
||||
IonButton,
|
||||
IonIcon,
|
||||
IonMenuButton,
|
||||
IonContent
|
||||
} from '@ionic/react';
|
||||
|
||||
import { IonButtons, IonToolbar, IonBackButton, IonTitle, IonButton, IonIcon, IonMenuButton } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<>
|
||||
export const ButtonsExample: React.FunctionComponent = () => (
|
||||
<IonContent>
|
||||
<IonToolbar>
|
||||
<IonButtons slot="start">
|
||||
<IonBackButton goBack={() => {}} />
|
||||
<IonBackButton defaultHref="/" />
|
||||
</IonButtons>
|
||||
<IonTitle>Back Button</IonTitle>
|
||||
</IonToolbar>
|
||||
@ -17,13 +25,13 @@ const Example: React.SFC<{}> = () => (
|
||||
<IonButton>
|
||||
<IonIcon slot="icon-only" name="contact" />
|
||||
</IonButton>
|
||||
<IonButton> />
|
||||
<IonButton>
|
||||
<IonIcon slot="icon-only" name="search" />
|
||||
</IonButton>
|
||||
</IonButtons>
|
||||
<IonTitle>Default Buttons</IonTitle>
|
||||
<IonButtons slot="primary">
|
||||
<IonButton color="secondary"> />
|
||||
<IonButton color="secondary">
|
||||
<IonIcon slot="icon-only" name="more" />
|
||||
</IonButton>
|
||||
</IonButtons>
|
||||
@ -40,7 +48,6 @@ const Example: React.SFC<{}> = () => (
|
||||
<IonMenuButton autoHide={false} />
|
||||
</IonButtons>
|
||||
</IonToolbar>
|
||||
</>
|
||||
</IonContent>
|
||||
);
|
||||
|
||||
export default Example;
|
||||
```
|
||||
Reference in New Issue
Block a user