mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
docs(): update examples and usage
This commit is contained in:
@ -1,7 +1,14 @@
|
||||
import { Component, Element, Event, EventEmitter, Method, Prop, Watch } from '@stencil/core';
|
||||
import {
|
||||
Component,
|
||||
Element,
|
||||
Event,
|
||||
EventEmitter,
|
||||
Method,
|
||||
Prop,
|
||||
Watch
|
||||
} from '@stencil/core';
|
||||
import { Color, Mode, StyleEvent } from '../../interface';
|
||||
|
||||
|
||||
@Component({
|
||||
tag: 'ion-label',
|
||||
styleUrls: {
|
||||
@ -13,20 +20,16 @@ import { Color, Mode, StyleEvent } from '../../interface';
|
||||
}
|
||||
})
|
||||
export class Label {
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
/**
|
||||
* The color to use from your Sass `$colors` map.
|
||||
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
|
||||
* For more information, see [Theming your App](/docs/theming/theming-your-app).
|
||||
* The color to use for the label's text
|
||||
*/
|
||||
@Prop() color?: Color;
|
||||
|
||||
/**
|
||||
* The mode determines which platform styles to use.
|
||||
* Possible values are: `"ios"` or `"md"`.
|
||||
* For more information, see [Platform Styles](/docs/theming/platform-specific-styles).
|
||||
*/
|
||||
@Prop() mode!: Mode;
|
||||
|
||||
@ -54,7 +57,7 @@ export class Label {
|
||||
positionChanged() {
|
||||
const position = this.position;
|
||||
return this.ionStyle.emit({
|
||||
[`label-${position}`]: !!position,
|
||||
[`label-${position}`]: !!position
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# ion-label
|
||||
|
||||
Label is a wrapper element that can be used in combination with `ion-item`.
|
||||
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
24
core/src/components/label/usage/javascript.md
Normal file
24
core/src/components/label/usage/javascript.md
Normal file
@ -0,0 +1,24 @@
|
||||
```html
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>Default</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
<ion-item text-wrap>
|
||||
<ion-label>Wrap label this label just goes on and on and on</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="fixed">Fixed</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="floating">Floating</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Stacked</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
```
|
||||
Reference in New Issue
Block a user