【发布时间】:2017-12-22 00:34:43
【问题描述】:
我使用离子 3
图片文件是\src\assets\img
基本页面
export class BasicPage {
items = [];
constructor(public nav: NavController ,private admob: AdMob) {
this.items = [
{
'title': ' Managing Coins & Gems ',
'icon': 'assets/img/icone2.png',
'description': ' a way to farm gems ifem pack.<br><br> <img src="assets/img/pic3.jpg"> <br><br> Shadow Fight ments are about 15 seconds long for 1 Gem. <br><br> <img src="./assets/img/pic4.jpg"> <br><br> There’s also a rewards by completing in game achievements. This usually gives a player about 1 Gem per achievement, but as you go through the game, the rewards ramp up proportionally. You havecon).<br><br> <img src="assets/img/pic5.jpg"> <br><br>',
'color': '#FFD439'
},
{
'title': ' Gear Sets, Skill Trees & Moves ',
'icon': 'assets/img/icone3.png',
'description': ' Unless <br> Skill trees in the bump. <br><br> <img src="assets/img/pic7.jpg"> <br><br>Make ',
'color': '#CE6296'
},
]
}
和类导航
export class NavigationDetailsPage {
item;
constructor(params: NavParams) {
this.item = params.data.item;
}
}
在html页面导航
<ion-header>
<ion-navbar>
<ion-title>Shadow Fight 2 guide</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-list>
<button ion-item *ngFor="let item of items" (click)="openNavDetailsPage(item)" icon-start>
<ion-avatar item-start>
<img src= {{item.icon}}>
</ion-avatar>
{{ item.title }}
</button>
</ion-list>
</ion-content>
导航细节
<ion-header>
<ion-navbar>
<ion-title>
{{ item.title }}
</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-icon [name]="'logo-' + item.icon" [ngStyle]="{'color': item.color}"></ion-icon>
<div [innerHTML]="item.description">
</div>
</ion-content>
ionic serve 一切正常 但 离子运行--设备 图标显示,但描述中没有
【问题讨论】:
标签: javascript html angular ionic2 ionic3