问题描述
错误:- Tribute.js:159 Tribute 已经绑定到 BODY
当我使用 froala fullPage 时.. 我也阅读了文档,没有地方提到这个问题。只有当我添加 fullpage 选项并将其设置为 true 时才会出现错误。 这无助于我想出任何解决方案。
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tribute.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/js/froala_editor.pkgd.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/froala_editor.pkgd.min.css" rel="stylesheet"/>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tribute.css" rel="stylesheet"/>
<h4> with Tribute </h4>
<div id="Not working with Tribute"></div>
<h4> withoutTribute </h4>
<div id="Working with Tribute"></div>
<script>
var tribute = new Tribute({
values: [
{ key: 'Phil',value: 'pheartman' },{ key: 'Gordon',value: 'gramsey' },{ key: 'Jacob',value: 'jacob' },{ key: 'Ethan',value: 'ethan' },{ key: 'emma',value: 'emma' },{ key: 'Isabella',value: 'isabella' }
],selectTemplate: function(item) {
return '<span class="fr-deletaable fr-tribute">' + item.original.key + '</a></span>';
}
})
new FroalaEditor('#withTribute',{
fullPage: true,events: {
initialized: function() {
var editor = this;
tribute.attach(editor.el)
editor.events.on('keydown',function(e) {
if (e.which == FroalaEditor.KEYCODE.ENTER && tribute.isActive) {
return false;
}
},true);
}
}
});
new FroalaEditor('#withoutTribute',{
fullPage: false,true);
}
}
});
</script>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)