ion-img
Img は、タグがビューポートに表示されているときに画像をLazy Loadするタグです。これは、画像が表示されているときにのみロードされるため、巨大なリストを生成する場合に非常に便利です。このコンポーネントは Intersection Observer を内部的に使用します。Intersection Observerは、最近のほとんどのブラウザでサポートされていますが、サポートされていない場合は setTimeout で処理されます。
Basic Usage
プロパティ
alt
| Description | This attribute defines the alternative text describing the image. Users will see this text displayed if the image URL is wrong, the image is not in one of the supported formats, or if the image is not yet downloaded. |
| Attribute | alt |
| Type | string | undefined |
| Default | undefined |
src
| Description | The image URL. This attribute is mandatory for the <img> element. |
| Attribute | src |
| Type | string | undefined |
| Default | undefined |
イベント
| Name | Description |
|---|---|
ionError | Emitted when the img fails to load |
ionImgDidLoad | Emitted when the image has finished loading |
ionImgWillLoad | Emitted when the img src has been set |
メソッド
No public methods available for this component.
CSS Shadow Parts
| Name | Description |
|---|---|
image | The inner img element. |
CSSカスタムプロパティ
No CSS custom properties available for this component.
Slots
No slots available for this component.