mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
refactor(all): strict boolean conditions
This commit is contained in:
@ -8,11 +8,11 @@ SelectOption is a component that is a child element of Select. For more informat
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Attribute | Description | Type |
|
||||
| ---------- | ---------- | ------------------------------------------------------------------------------ | --------- |
|
||||
| `disabled` | `disabled` | If true, the user cannot interact with the select option. Defaults to `false`. | `boolean` |
|
||||
| `selected` | `selected` | If true, the element is selected. | `boolean` |
|
||||
| `value` | -- | The text value of the option. | `any` |
|
||||
| Property | Attribute | Description | Type |
|
||||
| ---------- | ---------- | ------------------------------------------------------------------------------ | ------------- |
|
||||
| `disabled` | `disabled` | If true, the user cannot interact with the select option. Defaults to `false`. | `boolean` |
|
||||
| `selected` | `selected` | If true, the element is selected. | `boolean` |
|
||||
| `value` | -- | The text value of the option. | `any`, `null` |
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
@ -22,7 +22,7 @@ export class SelectOption {
|
||||
/**
|
||||
* The text value of the option.
|
||||
*/
|
||||
@Prop({ mutable: true }) value!: any;
|
||||
@Prop({ mutable: true }) value!: any | null;
|
||||
|
||||
/**
|
||||
* Emitted when the select option loads.
|
||||
@ -35,7 +35,7 @@ export class SelectOption {
|
||||
@Event() ionSelectOptionDidUnload!: EventEmitter<void>;
|
||||
|
||||
componentWillLoad() {
|
||||
if (this.value === undefined) {
|
||||
if (this.value == null) {
|
||||
this.value = this.el.textContent || '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user