gpt4 book ai didi

ionic-framework - ionic : Ionic avatar is not displaying

转载 作者:行者123 更新时间:2023-12-03 08:53:54 29 4
gpt4 key购买 nike

item-avatar 在我的项目中不起作用,它根本不显示 item-avatar 元素。

  <ion-content padding>
<ion-list>
<ion-list-header>
Recent Conversations
</ion-list-header>
<ion-item>
<item-avatar start>
<img src="https://ionicframework.com/docs/demos/api/avatar/avatar.svg">
</item-avatar>
<ion-label>
<h2>Finn</h2>
<h3>I'm a big deal</h3>
<p>Listen, I've had a pretty messed up day...</p>
</ion-label>
</ion-item>

<ion-item item-start>
<item-avatar start>
<img src="https://ionicframework.com/docs/demos/api/avatar/avatar.svg">
</item-avatar>
<ion-label>
<h2>Finn</h2>
<h3>I'm a big deal</h3>
<p>Listen, I've had a pretty messed up day...</p>
</ion-label>
</ion-item>

<ion-item slot="start">
<item-avatar start>
<img src="https://ionicframework.com/docs/demos/api/avatar/avatar.svg">
</item-avatar>
<ion-label>
<h2>Finn</h2>
<h3>I'm a big deal</h3>
<p>Listen, I've had a pretty messed up day...</p>
</ion-label>
</ion-item>
</ion-list>
</ion-content>

封装 JSON

"rxjs": "5.4.0",
"core-js": "2.4.1",
"zone.js": "0.8.12",
"typescript": "2.3.4",
"@angular/core": "5.2.9",
"@angular/http": "4.1.3",
"ionic-angular": "3.9.2",
"@angular/forms": "5.2.9",
"@angular/common": "5.2.9",
"@angular/compiler": "5.2.9",
"@angular/compiler-cli": "5.2.9",
"@angular/platform-browser": "5.2.9",
"@angular/platform-browser-dynamic": "5.2.9"

下面是项目的 stackblitz url

https://stackblitz.com/edit/ionic-mntalz

它应该在左侧显示图像

最佳答案

您在 <item-avatar start> 处犯了一个错误

更改为:

<ion-avatar item-start>
<img src="https://ionicframework.com/docs/demos/api/avatar/avatar.svg">
</ion-avatar>

工作代码:

<ion-content padding>
<ion-list>
<ion-list-header>
Recent Conversations
</ion-list-header>
<ion-item>
<ion-avatar item-start>
<img src="https://ionicframework.com/docs/demos/api/avatar/avatar.svg">
</ion-avatar>
<ion-label>
<h2>Finn</h2>
<h3>I'm a big deal</h3>
<p>Listen, I've had a pretty messed up day...</p>
</ion-label>
</ion-item>

<ion-item item-start>
<ion-avatar item-start>
<img src="https://ionicframework.com/docs/demos/api/avatar/avatar.svg">
</ion-avatar>
<ion-label>
<h2>Finn</h2>
<h3>I'm a big deal</h3>
<p>Listen, I've had a pretty messed up day...</p>
</ion-label>
</ion-item>

<ion-item slot="start">
<ion-avatar item-start>
<img src="https://ionicframework.com/docs/demos/api/avatar/avatar.svg">
</ion-avatar>
<ion-label>
<h2>Finn</h2>
<h3>I'm a big deal</h3>
<p>Listen, I've had a pretty messed up day...</p>
</ion-label>
</ion-item>
</ion-list>
</ion-content>

引用链接:https://ionicframework.com/docs/v3/components/#multiline-list

工作演示:https://stackblitz.com/edit/ionic-z5icij

关于ionic-framework - ionic : Ionic avatar is not displaying,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57054991/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com