【问题标题】:Import and use jellyjs plugin parcel导入和使用 jellyjs 插件包
【发布时间】:2019-08-22 07:09:45
【问题描述】:

我正在使用parcel 并遇到使用Jelly.js 并尝试按照说明导入

import $ from "jquery";
import 'jquery-scrollify';
import { Jelly } from 'jelly.js';

$(function(){
    var options = {
        paths: '#circle-path',     // Shape we want to draw
        pointsNumber: 25,            // Number of points
        maxDistance: 4,             // Max distance among points
        color: '#ff0019',
        opacity: 0.27,
        // centroid: '.centroid-text'   // Element to move accordingly with the centroid of the shape
        // debug: true               // Uncomment this to see the points
    };

    /* Initializing jelly */

    var jelly = new Jelly('.jelly-canvas', options);
});

但它会抛出这个错误

Uncaught ReferenceError: Jelly is not defined

有什么想法吗?

【问题讨论】:

    标签: javascript webpack ecmascript-6 parcel


    【解决方案1】:

    这是因为元素.jelly-canvas不存在并且

    import { Jelly } from 'jelly.js';
    

    应该是

    import Jelly from 'jelly.js';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-12
      • 2022-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多