我在我的 html 正文中包含了以下内容:
{{> editor}}
和下面的模板
<template name="editor">
<div id="summernote">Hello Summernote</div>
</template>
在我的 javascript 代码中,我有以下内容:
Template.editor.onRendered(function()
{
this.$('.summernote').summernote();
});
我看到的不是完整的 summernote 富文本编辑器。我做错了什么?
最佳答案
您的元素的 id
为 'summernote',但您的选择器正在寻找具有 class
或 'summernote' 的元素
将选择器更改为 $('#summernote')
,如下所示:
Template.editor.onRendered(function() {
this.$('#summernote').summernote();
}
关于javascript - 在 Meteor 中使用 Summernote 编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33623857/