代码之家  ›  专栏  ›  技术社区  ›  Organiccat

在ngRepeat和Foundation框架中使用ngClass

  •  0
  • Organiccat  · 技术社区  · 11 年前

    我发现,当我正在使用的Foundation框架在ng repeat中使用时,我的ng类会被覆盖。代码相对简单:

    <tr ng-repeat="goal in goals" ng-class="goal.difficulty">
    

    我可以看到在chrome开发工具中应用了该类,但它被tables.scss样式覆盖

    tables tr:nth-of-type(even)
    

    我有 我的 CSS是在基础CSS之后,所以我对这是如何发生的有些不知所措。

    编辑:

    由于人们不相信这里覆盖的是图像(您也可以从Github查看该项目)

    http://imgur.com/BtQjInF

    https://github.com/OrganicCat/goal-tracker

    1 回复  |  直到 11 年前
        1
  •  1
  •   Peter Ashwell    11 年前

    试着放!重要的是在类样式定义的末尾,以便它们覆盖基础。

    这不是一个解决方案,但它表明你的造型与祖布有冲突。正确的答案是使用sass从zurb中删除默认的表样式,特别是:

    // These control the background color for the table and even rows
    $table-bg: $white;
    $table-even-row-bg: $snow;
    

    http://foundation.zurb.com/docs/components/tables.html

    我不相信该类没有应用于元素(除非您发布了一些呈现的html,否则会显示其他内容)。