UI自举下拉似乎不与0.12.0版本工作 [英] ui-bootstrap drop down seems to be not working with version 0.12.0

查看:109
本文介绍了UI自举下拉似乎不与0.12.0版本工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

东西似乎已与用户界面,引导的0.12.0版本打破。这里是我的plunkr,显示问题

Something seems to have been broken with version 0.12.0 of ui-bootstrap. Here is my plunkr that shows the issue

这适用于0.11.0版

This works with version 0.11.0

<一个href=\"http://plnkr.co/edit/9XJx2c2X7lRSc6V1n5BO?p=$p$pview\">http://plnkr.co/edit/9XJx2c2X7lRSc6V1n5BO?p=$p$pview

有了这个plunkr如果你替换下面的行

With this plunkr if you replace the following line

<script data-require="ui-bootstrap@*" data-semver="0.11.0" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.min.js"></script>

<script data-require="ui-bootstrap@*" data-semver="0.12.0" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.12.0.min.js"></script>

然后下拉停止工作(当你点击)。我不知道如果这是一个回归或没有,但任何变通办法真的会很有帮助。 0.12.0包含了许多重要的是我,所以我要升级修复。

then the drop down stops working (when you click). I am not sure if this is a regression or not but any workarounds would really be helpful. 0.12.0 has a bunch of fixes that are important for me and hence I have to upgrade.

任何帮助是AP preciated。

Any help is appreciated.

推荐答案

我已通过了同样的问题去之前,从源头上发现了指令不是类 C 不再受到限制。你可以为他们提供的属性。由于bootstrap.css还为与类名的下拉规则下拉菜单下拉拨动下拉菜单和指令也曾经是限制类使用它们只用在0.11.0类名的规范工作。但是,这似乎已经与0.12.0改变和指令都不再 C 限制(而不是他们遵循角指令默认指令限制规则,即 EA 限制为1.3和 A 1.2版本),但是CSS规则保持不变,因此使用这两种。

I had gone through the same issue before, found out from the source that directives are not class C restricted anymore. You can provide them as attributes. Since the bootstrap.css also defines the rules for the dropdown with the class names dropdown, dropdown-toggle, dropdown-menu and the directives also used to be class restricted they used to work with just the specification of class names in 0.11.0. But this seems to have been changed with 0.12.0 and the directives are no longer C restricted (instead they follow default directive restriction rule of angular directive, i.e EA restricted for 1.3 and A for 1.2 versions), however css rules remain the same, hence use both.

尝试:

    <span class="dropdown" dropdown>
    <a href="" class="dropdown-toggle" dropdown-toggle>
        Click
    </a>
    <ul class="dropdown-menu" dropdown-menu>
      <li> 
        <a ng-click="action1()">Action1</a>
      </li>
      <li>
        <a ng-click="action2()">Action2</a>
      </li>
      <li>
        <a ng-click="action3()">Action3</a>
      </li>
      <li>
        <a ng-click="action4()">Action4</a>
      </li>
      <li>
        <a ng-click="action5()">Action5</a>
      </li>
    </ul>

Plnkr

Plnkr

这篇关于UI自举下拉似乎不与0.12.0版本工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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