mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
docs(option): update docs
This commit is contained in:
@ -4,6 +4,12 @@ import {isDefined, isTrueProperty} from '../../util/util';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Option
|
* @name Option
|
||||||
|
* @description
|
||||||
|
* `ion-option` is a child component of `ion-select`. Similar to the native option element, `ion-option` can take a value and a checked property.
|
||||||
|
*
|
||||||
|
* @property [value] - the value of the option
|
||||||
|
* @property [checked] - whether or not the option is already checked and selected
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'ion-option'
|
selector: 'ion-option'
|
||||||
@ -12,10 +18,16 @@ export class Option {
|
|||||||
private _checked: any = false;
|
private _checked: any = false;
|
||||||
private _value;
|
private _value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
@Output() select: EventEmitter<any> = new EventEmitter();
|
@Output() select: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
constructor(private _elementRef: ElementRef) {}
|
constructor(private _elementRef: ElementRef) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
get checked() {
|
get checked() {
|
||||||
return this._checked;
|
return this._checked;
|
||||||
@ -25,6 +37,9 @@ export class Option {
|
|||||||
this._checked = isTrueProperty(val);
|
this._checked = isTrueProperty(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
get value() {
|
get value() {
|
||||||
if (isDefined(this._value)) {
|
if (isDefined(this._value)) {
|
||||||
@ -37,6 +52,9 @@ export class Option {
|
|||||||
this._value = val;
|
this._value = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
get text() {
|
get text() {
|
||||||
return this._elementRef.nativeElement.textContent;
|
return this._elementRef.nativeElement.textContent;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user