0

Ionic バージョン 5.4.16tag を使用しており、Web アプリで画像を表示するために を使用しましたが、ページを読み込むと画像が壊れた画像として表示されます。画像は以下に添付されています:これは私が画像を作成するために使用するコードです:




<!-- language: tsx -->

    <IonRow className="ion-justify-content-center ion-text-center">
    <IonCol></IonCol>
    <IonCol size="3">
      <IonImg src="icon.png" />
      <div className="spinner">erie</div>
    </IonCol>
    <IonCol></IonCol>
    </IonRow>



ここに画像の説明を入力

4

1 に答える 1

1

IonImg コンポーネントで使用する前に、イメージをインポートする必要があります。例えば:

import myImage from './icon.png'

...

<IonImg src={myImage} />
于 2021-04-15T01:29:10.197 に答える