mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
docs(stencil): add stencil usage to components (#21261)
This commit is contained in:
37
core/src/components/content/usage/stencil.md
Normal file
37
core/src/components/content/usage/stencil.md
Normal 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>
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user