【问题标题】:Using Summernote editor with Meteor将 Summernote 编辑器与 Meteor 一起使用
【发布时间】:2016-02-10 23:14:39
【问题描述】:

我在我的 html 正文中包含以下内容:

{{> editor}}

和下面的模板

<template name="editor">
    <div id="summernote">Hello Summernote</div>
</template>

在我的 javascript 代码中,我有以下内容:

Template.editor.onRendered(function()
{
 this.$('.summernote').summernote();
});

我看到的是以下内容,而不是完整的 Summernote 富文本编辑器。我做错了什么?

【问题讨论】:

  • 如果您从浏览器控制台执行$('.summernote').summernote(); 一切正常?

标签: javascript meteor summernote


【解决方案1】:

您的元素有一个 id 'summernote',但您的选择器正在寻找一个带有 class 或 'summernote' 的元素

将您的选择器更改为$('#summernote'),如下所示:

Template.editor.onRendered(function() {
  this.$('#summernote').summernote();
}

【讨论】:

    猜你喜欢
    • 2014-07-08
    • 2021-12-05
    • 2017-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-10
    • 2021-01-27
    • 2017-06-05
    相关资源
    最近更新 更多