< ion-list>之间的差异和< div class =" list">在离子框架? [英] Difference between <ion-list> and <div class="list"> in Ionic framework?

查看:165
本文介绍了< ion-list>之间的差异和< div class =" list">在离子框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Ionic Framework 构建应用。我开始使用入门指南中所述的标准离子标签启动器项目。在列表中,我现在想要在此处描述分隔符

I'm building an app with the Ionic Framework. I started off with the standard ionic tabs starter project as described in the getting started guide. In a list I now want to put a divider as described here:

<div class="list">
  <div class="item item-divider"> <!-- this creates the divider -->
    Candy Bars
  </div>
  <a class="item" href="#">
    Butterfinger
  </a>
  ...
</div>

令我惊讶的是,我列表中预生成的代码如下所示:

to my surprise however, the pre generated code in my list looks like this:

<ion-list>
  <ion-item class="item-toggle">
    Enable Friends
    <label class="toggle">
      <input type="checkbox" ng-model="settings.enableFriends">
      <div class="track">
        <div class="handle"></div>
      </div>
    </label>
  </ion-item>
</ion-list>

所以这让我想知道:之间的区别是什么(如果有的话) < ion-list> < div class =list>

So this made me wonder: what is (if any) the difference between <ion-list> and <div class="list">?

根据预先生成的代码,我尝试使用< ion-divider> 创建分隔符,但这不起作用。所以我住在< div class =item item-divider> ,它可以正常工作。我只是想知道这些魔术< ion-xxx> 标签和传统的< div class =xxx>之间有什么区别; 标签?

In line with the pre-generated code I tried to create a divider using <ion-divider>, but that didn't work. So I resided to <div class="item item-divider"> which works fine. I just wonder what the difference is between these "magic" <ion-xxx> tags and the traditional <div class="xxx"> tags?

欢迎提供任何信息!

推荐答案

我相信使用标准的HTML格式,例如< div class =list> ,将为您提供所需的所有CSS样式,但在某些情况下,使用Ionic指令将提供纯HTML / CSS可能缺少的其他功能。查看此链接到Ionic论坛了解更多信息。主题。

I believe that using the standard HTML formatting such as <div class="list">will give you all the CSS styling that you are looking for, but in some cases using the Ionic directives will provide additional functionality that may be missing with pure HTML/CSS. Check out this link to the Ionic forums for more info on the subject.

这篇关于&lt; ion-list&gt;之间的差异和&lt; div class =&quot; list&quot;&gt;在离子框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆