我對Ionic並不陌生,但不幸的是我無法弄清楚爲什麼會發生這種情況。ionic2卡和圖標沒有顯示
我想在新創建的項目上創建一張簡單的卡片列表,但它們似乎不起作用。我試着分別使用圖標和卡片,但似乎也沒有工作。
正如我所說的,我創建了一個全新的項目,擁有標準的「home-about-etc」模板,並用內部的div替換了home.html文件中的HTML。下面是代碼:
<ion-header>
<ion-navbar>
<ion-title>Home</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<div class="card">
<div class="item item-divider">
I'm a Header in a Card!
</div>
<div class="item item-text-wrap">
This is a basic Card with some text.
</div>
<div class="item item-divider">
I'm a Footer in a Card!
</div>
</div>
</ion-content>
這是目前正在調查中的一個常見問題,因爲我真的不明白我怎麼可能做錯了什麼,因爲我纔剛剛創造了這個全新的項目和從v2網站直接複製粘貼卡片的模板?
編輯:
的Home.ts類的代碼:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {
}
}
非常感謝!
在你的'index.html'你還有' '切入點?主頁組件的代碼是什麼樣的? –
@AlexanderStaroselsky我還有,是的。正如我所說,我沒有改變任何東西,只是顯示'Hello to Ionic2'文本的html代碼與上面顯示的代碼。我已經使用上面的主頁類組件中的代碼編輯了我的帖子。 – user3153278
嘗試從該模板中刪除「 ... 」部分,看看是否有任何呈現。也許'需要額外的配置,可能會阻止渲染。 –