mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 10:41:13 +08:00
refactor(all): update to one (part 3) (#18874)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Component, ComponentInterface, Prop, h } from '@stencil/core';
|
||||
import { Component, ComponentInterface, Host, Prop, h } from '@stencil/core';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
@ -40,30 +40,28 @@ export class InfiniteScrollContent implements ComponentInterface {
|
||||
}
|
||||
}
|
||||
|
||||
hostData() {
|
||||
const mode = getIonMode(this);
|
||||
return {
|
||||
class: {
|
||||
[mode]: true,
|
||||
|
||||
// Used internally for styling
|
||||
[`infinite-scroll-content-${mode}`]: true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const mode = getIonMode(this);
|
||||
return (
|
||||
<div class="infinite-loading">
|
||||
{this.loadingSpinner && (
|
||||
<div class="infinite-loading-spinner">
|
||||
<ion-spinner name={this.loadingSpinner} />
|
||||
</div>
|
||||
)}
|
||||
{this.loadingText && (
|
||||
<div class="infinite-loading-text" innerHTML={sanitizeDOMString(this.loadingText)} />
|
||||
)}
|
||||
</div>
|
||||
<Host
|
||||
class={{
|
||||
[mode]: true,
|
||||
|
||||
// Used internally for styling
|
||||
[`infinite-scroll-content-${mode}`]: true
|
||||
}}
|
||||
>
|
||||
<div class="infinite-loading">
|
||||
{this.loadingSpinner && (
|
||||
<div class="infinite-loading-spinner">
|
||||
<ion-spinner name={this.loadingSpinner} />
|
||||
</div>
|
||||
)}
|
||||
{this.loadingText && (
|
||||
<div class="infinite-loading-text" innerHTML={sanitizeDOMString(this.loadingText)} />
|
||||
)}
|
||||
</div>
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user