文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Usage with Froala WYSIWYG HTML Editor
Froala WYSIWYG HTML Editor V2
You can download Froala Editor from their official website.
Javascript
// Define data source for At.JS. var datasource = ["Jacob", "Isabella", "Ethan", "Emma", "Michael", "Olivia" ]; // Build data to be used in At.JS config. var names = $.map(datasource, function (value, i) { return { 'id': i, 'name': value, 'email': value + "@email.com" }; }); // At.JS config. var config = { at: ``"@", data: names, displayTpl: '<li>${name} <small>${email}</small></li>', limit: 200 } // Init Editor. $('#editor') .on('froalaEditor.initialized', function (e, editor) { // Add At.JS editor.$el .atwho(config) .on('inserted.atwho', function () { editor.$el.find('.atwho-inserted').removeAttr('contenteditable'); }) editor.events.on('keydown', function (e) { if (e.which == $.FroalaEditor.KEYCODE.ENTER && editor.$el.atwho('isSelecting')) { return false; } }, true); }) .froalaEditor()
Live example
Live demo: https://www.froala.com/wysiwyg-editor/docs/examples/at-js.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论