gpt4 book ai didi

javascript - 使用带有 ES6 导入的 jQuery 插件

转载 作者:搜寻专家 更新时间:2023-10-31 23:40:43 24 4
gpt4 key购买 nike

我已经安装了 jquery 插件 summernote使用 npm,它在我的 node_modules 目录中。

我现在正在尝试使用 summernote 函数,就像我以前在 html 中加载脚本时一样。

import { summernote } from 'summernote';

export default function () {
const summernote = $('.editor');
summernote.summernote();
}

我无法通过上面的代码抛出 summernote.summernote is not a function

最佳答案

This module doesn't export anything useful (就像它应该来自 jQuery 插件包一样)。

未使用导入的 summernote,未使用的导入成员使导入成为一个 noop。

应该是

import 'summernote';

关于javascript - 使用带有 ES6 导入的 jQuery 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43640607/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com