mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
fix(all): component reusage (#18963)
Use new stencil APIs to allow ionic elements to be reused once removed from the DOM. fixes #18843 fixes #17344 fixes #16453 fixes #15879 fixes #15788 fixes #15484 fixes #17890 fixes #16364
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Prop, h } from '@stencil/core';
|
||||
import { Component, ComponentInterface, Element, Host, Prop, h } from '@stencil/core';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
|
||||
@ -26,33 +26,7 @@ export class SelectOption implements ComponentInterface {
|
||||
/**
|
||||
* The text value of the option.
|
||||
*/
|
||||
@Prop({ mutable: true }) value?: any | null;
|
||||
|
||||
/**
|
||||
* Emitted when the select option loads.
|
||||
* @internal
|
||||
*/
|
||||
@Event() ionSelectOptionDidLoad!: EventEmitter<void>;
|
||||
|
||||
/**
|
||||
* Emitted when the select option unloads.
|
||||
* @internal
|
||||
*/
|
||||
@Event() ionSelectOptionDidUnload!: EventEmitter<void>;
|
||||
|
||||
componentWillLoad() {
|
||||
if (this.value === undefined) {
|
||||
this.value = this.el.textContent || '';
|
||||
}
|
||||
}
|
||||
|
||||
componentDidLoad() {
|
||||
this.ionSelectOptionDidLoad.emit();
|
||||
}
|
||||
|
||||
componentDidUnload() {
|
||||
this.ionSelectOptionDidUnload.emit();
|
||||
}
|
||||
@Prop() value?: any | null;
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user