简体   繁体   English

ionic2卡和图标未显示

[英]ionic2 cards and icons not showing up

I am not new to Ionic, but unfortunately I couldn't figure out why this is happening. 我对Ionic并不陌生,但不幸的是我不知道为什么会这样。

I am trying to create a simple list of cards on a newly created project, but they don't seem to work. 我正在尝试在新创建的项目上创建卡片的简单列表,但是它们似乎不起作用。 I tried using both the icons and the cards separately and that didn't seem to work either. 我尝试分别使用图标和卡片,但似乎也不起作用。

As I said, I have created a brand new project, having the standard "home-about-etc" template, and have replaced the HTML inside the home.html file with a div with cards inside. 就像我说的,我创建了一个全新的项目,它具有标准的“ home-about-etc”模板,并且用带有卡片的div替换了home.html文件中的HTML。 Here is the code: 这是代码:

 <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>

Is this a common issue that is currently being under investigation, because I really don't see how I might have done anything wrong, since I have only just created this brand new project and have copy-pasted the template for cards straight from the v2 website? 这是当前正在调查的常见问题吗,因为我真的不知道怎么做错什么,因为我才刚刚创建了这个全新项目,并直接从v2复制粘贴了卡模板网站?

EDIT: 编辑:

Code of the Home.ts class : 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) {

  }

}

Many thanks! 非常感谢!

try using it as this: 尝试按以下方式使用它:

<ion-card>
  <ion-card-content>
  </ion-card-content>
</ion-card>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM