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

@ -163,6 +163,58 @@ export const RefresherExample: React.FC = () => (
```
### Stencil
```tsx
import { Component, h } from '@stencil/core';
@Component({
tag: 'refresher-example',
styleUrl: 'refresher-example.css'
})
export class RefresherExample {
doRefresh(ev: any) {
console.log('Begin async operation');
setTimeout(() => {
console.log('Async operation has ended');
ev.target.complete();
}, 2000);
}
render() {
return [
// Default Refresher
<ion-content>
<ion-refresher slot="fixed" onIonRefresh={(ev) => this.doRefresh(ev)}>
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
</ion-content>,
// Custom Refresher Properties
<ion-content>
<ion-refresher slot="fixed" pullFactor={0.5} pullMin={100} pullMax={200}>
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
</ion-content>,
// Custom Refresher Content
<ion-content>
<ion-refresher slot="fixed" onIonRefresh={(ev) => this.doRefresh(ev)}>
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="Pull to refresh"
refreshingSpinner="circles"
refreshingText="Refreshing...">
</ion-refresher-content>
</ion-refresher>
</ion-content>
];
}
}
```
### Vue
```html

View File

@ -0,0 +1,48 @@
```tsx
import { Component, h } from '@stencil/core';
@Component({
tag: 'refresher-example',
styleUrl: 'refresher-example.css'
})
export class RefresherExample {
doRefresh(ev: any) {
console.log('Begin async operation');
setTimeout(() => {
console.log('Async operation has ended');
ev.target.complete();
}, 2000);
}
render() {
return [
// Default Refresher
<ion-content>
<ion-refresher slot="fixed" onIonRefresh={(ev) => this.doRefresh(ev)}>
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
</ion-content>,
// Custom Refresher Properties
<ion-content>
<ion-refresher slot="fixed" pullFactor={0.5} pullMin={100} pullMax={200}>
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
</ion-content>,
// Custom Refresher Content
<ion-content>
<ion-refresher slot="fixed" onIonRefresh={(ev) => this.doRefresh(ev)}>
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="Pull to refresh"
refreshingSpinner="circles"
refreshingText="Refreshing...">
</ion-refresher-content>
</ion-refresher>
</ion-content>
];
}
}
```