mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
docs(stencil): add stencil usage to components (#21261)
This commit is contained in:
@ -71,6 +71,46 @@ export const NoteExample: React.FC = () => (
|
||||
```
|
||||
|
||||
|
||||
### Stencil
|
||||
|
||||
```tsx
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'note-example',
|
||||
styleUrl: 'note-example.css'
|
||||
})
|
||||
export class NoteExample {
|
||||
render() {
|
||||
return [
|
||||
// Default Note
|
||||
<ion-note>Default Note</ion-note>,
|
||||
|
||||
// Note Colors
|
||||
<ion-note color="primary">Primary Note</ion-note>,
|
||||
<ion-note color="secondary">Secondary Note</ion-note>,
|
||||
<ion-note color="danger">Danger Note</ion-note>,
|
||||
<ion-note color="light">Light Note</ion-note>,
|
||||
<ion-note color="dark">Dark Note</ion-note>,
|
||||
|
||||
// Notes in a List
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>Note (End)</ion-label>
|
||||
<ion-note slot="end">On</ion-note>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-note slot="start">Off</ion-note>
|
||||
<ion-label>Note (Start)</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Vue
|
||||
|
||||
```html
|
||||
|
36
core/src/components/note/usage/stencil.md
Normal file
36
core/src/components/note/usage/stencil.md
Normal file
@ -0,0 +1,36 @@
|
||||
```tsx
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'note-example',
|
||||
styleUrl: 'note-example.css'
|
||||
})
|
||||
export class NoteExample {
|
||||
render() {
|
||||
return [
|
||||
// Default Note
|
||||
<ion-note>Default Note</ion-note>,
|
||||
|
||||
// Note Colors
|
||||
<ion-note color="primary">Primary Note</ion-note>,
|
||||
<ion-note color="secondary">Secondary Note</ion-note>,
|
||||
<ion-note color="danger">Danger Note</ion-note>,
|
||||
<ion-note color="light">Light Note</ion-note>,
|
||||
<ion-note color="dark">Dark Note</ion-note>,
|
||||
|
||||
// Notes in a List
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>Note (End)</ion-label>
|
||||
<ion-note slot="end">On</ion-note>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-note slot="start">Off</ion-note>
|
||||
<ion-label>Note (Start)</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user