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:
@@ -38,7 +38,7 @@ By default, the split pane will expand when the screen is larger than 992px. To
|
||||
|
||||
```html
|
||||
<ion-split-pane contentId="main">
|
||||
<!-- our side menu -->
|
||||
<!-- the side menu -->
|
||||
<ion-menu contentId="main">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
@@ -57,7 +57,7 @@ By default, the split pane will expand when the screen is larger than 992px. To
|
||||
|
||||
```html
|
||||
<ion-split-pane content-id="main">
|
||||
<!-- our side menu -->
|
||||
<!-- the side menu -->
|
||||
<ion-menu content-id="main">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
@@ -92,7 +92,7 @@ import {
|
||||
export const SplitPlaneExample: React.SFC<{}> = () => (
|
||||
<IonContent>
|
||||
<IonSplitPane contentId="main">
|
||||
{/*-- our side menu --*/}
|
||||
{/*-- the side menu --*/}
|
||||
<IonMenu contentId="main">
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
@@ -109,12 +109,43 @@ export const SplitPlaneExample: React.SFC<{}> = () => (
|
||||
```
|
||||
|
||||
|
||||
### Stencil
|
||||
|
||||
```tsx
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'split-pane-example',
|
||||
styleUrl: 'split-pane-example.css'
|
||||
})
|
||||
export class SplitPaneExample {
|
||||
render() {
|
||||
return [
|
||||
<ion-split-pane content-id="main">
|
||||
{/* the side menu */}
|
||||
<ion-menu content-id="main">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Menu</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
</ion-menu>
|
||||
|
||||
{/* the main content */}
|
||||
<ion-router-outlet id="main"></ion-router-outlet>
|
||||
</ion-split-pane>
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Vue
|
||||
|
||||
```html
|
||||
<template>
|
||||
<ion-split-pane content-id="main">
|
||||
<!-- our side menu -->
|
||||
<!-- the side menu -->
|
||||
<ion-menu content-id="main">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
```html
|
||||
<ion-split-pane contentId="main">
|
||||
<!-- our side menu -->
|
||||
<!-- the side menu -->
|
||||
<ion-menu contentId="main">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
```html
|
||||
<ion-split-pane content-id="main">
|
||||
<!-- our side menu -->
|
||||
<!-- the side menu -->
|
||||
<ion-menu content-id="main">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
export const SplitPlaneExample: React.SFC<{}> = () => (
|
||||
<IonContent>
|
||||
<IonSplitPane contentId="main">
|
||||
{/*-- our side menu --*/}
|
||||
{/*-- the side menu --*/}
|
||||
<IonMenu contentId="main">
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
|
||||
27
core/src/components/split-pane/usage/stencil.md
Normal file
27
core/src/components/split-pane/usage/stencil.md
Normal file
@@ -0,0 +1,27 @@
|
||||
```tsx
|
||||
import { Component, h } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'split-pane-example',
|
||||
styleUrl: 'split-pane-example.css'
|
||||
})
|
||||
export class SplitPaneExample {
|
||||
render() {
|
||||
return [
|
||||
<ion-split-pane content-id="main">
|
||||
{/* the side menu */}
|
||||
<ion-menu content-id="main">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Menu</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
</ion-menu>
|
||||
|
||||
{/* the main content */}
|
||||
<ion-router-outlet id="main"></ion-router-outlet>
|
||||
</ion-split-pane>
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,7 +1,7 @@
|
||||
```html
|
||||
<template>
|
||||
<ion-split-pane content-id="main">
|
||||
<!-- our side menu -->
|
||||
<!-- the side menu -->
|
||||
<ion-menu content-id="main">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
|
||||
Reference in New Issue
Block a user