javascript - X-Editable 和 Bootstrap 4

标签 javascript jquery twitter-bootstrap bootstrap-4 x-editable

之前我已经使用 X-Editable 和 Bootstrap 3 实现了内联编辑。使用 Bootstrap 4 它似乎不再有效。 Check out the JsFiddle here.

如果我像这样定义一个简单的弹出窗口:

<div style="margin: 150px">
     <a href="#" class="comment" data-name="comment" data-type="text" data-pk="@item.Id" data-url="/" data-title="Enter comment">comment</a>
</div>

<script>
$(document).ready(function() {
        $('.comment').editable();
    });
</script>

它在 BS3 中工作正常,但一旦我切换到 BS4,它就不再工作并给出错误:

Uncaught TypeError: Cannot read property 'addClass' of undefined
at Popup.show (bootstrap-editable.js:1091)
at Editable.show (bootstrap-editable.js:1802)
at Editable.toggle (bootstrap-editable.js:1824)
at Editable.<anonymous> (bootstrap-editable.js:1547)
at HTMLAnchorElement.e (jquery-3.2.1.slim.min.js:2)

在控制台中。

我做错了什么?我应该使用不同的库/分支吗?

最佳答案

关于javascript - X-Editable 和 Bootstrap 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46926354/

相关文章:

javascript - 如何使用 javascript 从 JavaScript 对象(包含对象数组)获取所有值

javascript - 带有空字段的 HTML 表

jquery - 单击时禁用鼠标移动

javascript - 当url改变时加载ajax

ruby-on-rails-3 - Rails 3.2 使用 content_tag 生成带有 twitter-bootstrap 图标的 'Delete' 按钮

javascript - 使用 JavaScript 在 Power Query 中使用正则表达式

javascript - 解析beforeSave()云代码函数不起作用

javascript - 什么是数据类型以及如何初始化它?

css - 在同一列内 Bootstrap 不同大小

css - 如何在 Bootstrap 中设置输入标签之间的边距?