【发布时间】:2018-04-06 04:26:53
【问题描述】:
之前我已经使用 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)
在控制台中。
我做错了什么?我应该使用不同的库/fork 吗?
【问题讨论】:
标签: javascript jquery twitter-bootstrap bootstrap-4 x-editable