docs(stencil): add stencil usage to components (#21261)

This commit is contained in:
Brandy Carney
2020-05-12 20:35:48 -04:00
committed by GitHub
parent 703ef5c992
commit 687122127c
177 changed files with 11207 additions and 897 deletions

View File

@ -77,6 +77,47 @@ const ContentExample: React.FC = () => (
```
### Stencil
```tsx
import { Component, h } from '@stencil/core';
@Component({
tag: 'content-example',
styleUrl: 'content-example.css'
})
export class ContentExample {
logScrollStart() {
console.log('Scroll start');
}
logScrolling(ev) {
console.log('Scrolling', ev);
}
logScrollEnd() {
console.log('Scroll end');
}
render() {
return [
<ion-content
scrollEvents={true}
onIonScrollStart={() => this.logScrollStart()}
onIonScroll={(ev) => this.logScrolling(ev)}
onIonScrollEnd={() => this.logScrollEnd()}>
<h1>Main Content</h1>
<div slot="fixed">
<h1>Fixed Content</h1>
</div>
</ion-content>
];
}
}
```
### Vue
```html

View File

@ -0,0 +1,37 @@
```tsx
import { Component, h } from '@stencil/core';
@Component({
tag: 'content-example',
styleUrl: 'content-example.css'
})
export class ContentExample {
logScrollStart() {
console.log('Scroll start');
}
logScrolling(ev) {
console.log('Scrolling', ev);
}
logScrollEnd() {
console.log('Scroll end');
}
render() {
return [
<ion-content
scrollEvents={true}
onIonScrollStart={() => this.logScrollStart()}
onIonScroll={(ev) => this.logScrolling(ev)}
onIonScrollEnd={() => this.logScrollEnd()}>
<h1>Main Content</h1>
<div slot="fixed">
<h1>Fixed Content</h1>
</div>
</ion-content>
];
}
}
```