mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
docs(stencil): add stencil usage to components (#21261)
This commit is contained in:
@ -40,7 +40,7 @@ import { Component } from '@angular/core';
|
||||
styleUrls: ['./backdrop-example.css'],
|
||||
})
|
||||
export class BackdropExample {
|
||||
backdropDismiss = false;
|
||||
enableBackdropDismiss = false;
|
||||
showBackdrop = false;
|
||||
shouldPropagate = false;
|
||||
}
|
||||
@ -100,6 +100,46 @@ export const BackdropExample: React.FC = () => (
|
||||
```
|
||||
|
||||
|
||||
### Stencil
|
||||
|
||||
```tsx
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'backdrop-example',
|
||||
styleUrl: 'backdrop-example.css'
|
||||
})
|
||||
export class BackdropExample {
|
||||
render() {
|
||||
const enableBackdropDismiss = false;
|
||||
const showBackdrop = false;
|
||||
const shouldPropagate = false;
|
||||
|
||||
return [
|
||||
// Default backdrop
|
||||
<ion-backdrop></ion-backdrop>,
|
||||
|
||||
// Backdrop that is not tappable
|
||||
<ion-backdrop tappable={false}></ion-backdrop>,
|
||||
|
||||
// Backdrop that is not visible
|
||||
<ion-backdrop visible={false}></ion-backdrop>,
|
||||
|
||||
// Backdrop with propagation
|
||||
<ion-backdrop stopPropagation={false}></ion-backdrop>,
|
||||
|
||||
// Backdrop that sets dynamic properties
|
||||
<ion-backdrop
|
||||
tappable={enableBackdropDismiss}
|
||||
visible={showBackdrop}
|
||||
stopPropagation={shouldPropagate}>
|
||||
</ion-backdrop>
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Vue
|
||||
|
||||
```html
|
||||
@ -129,7 +169,7 @@ export const BackdropExample: React.FC = () => (
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
backdropDismiss = false;
|
||||
enableBackdropDismiss = false;
|
||||
showBackdrop = false;
|
||||
shouldPropagate = false;
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ import { Component } from '@angular/core';
|
||||
styleUrls: ['./backdrop-example.css'],
|
||||
})
|
||||
export class BackdropExample {
|
||||
backdropDismiss = false;
|
||||
enableBackdropDismiss = false;
|
||||
showBackdrop = false;
|
||||
shouldPropagate = false;
|
||||
}
|
||||
|
||||
36
core/src/components/backdrop/usage/stencil.md
Normal file
36
core/src/components/backdrop/usage/stencil.md
Normal file
@ -0,0 +1,36 @@
|
||||
```tsx
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'backdrop-example',
|
||||
styleUrl: 'backdrop-example.css'
|
||||
})
|
||||
export class BackdropExample {
|
||||
render() {
|
||||
const enableBackdropDismiss = false;
|
||||
const showBackdrop = false;
|
||||
const shouldPropagate = false;
|
||||
|
||||
return [
|
||||
// Default backdrop
|
||||
<ion-backdrop></ion-backdrop>,
|
||||
|
||||
// Backdrop that is not tappable
|
||||
<ion-backdrop tappable={false}></ion-backdrop>,
|
||||
|
||||
// Backdrop that is not visible
|
||||
<ion-backdrop visible={false}></ion-backdrop>,
|
||||
|
||||
// Backdrop with propagation
|
||||
<ion-backdrop stopPropagation={false}></ion-backdrop>,
|
||||
|
||||
// Backdrop that sets dynamic properties
|
||||
<ion-backdrop
|
||||
tappable={enableBackdropDismiss}
|
||||
visible={showBackdrop}
|
||||
stopPropagation={shouldPropagate}>
|
||||
</ion-backdrop>
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
backdropDismiss = false;
|
||||
enableBackdropDismiss = false;
|
||||
showBackdrop = false;
|
||||
shouldPropagate = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user