zoukankan      html  css  js  c++  java
  • layui 报错 jQuery is not defined

    Layui hint: jstree is not a valid module,layui 报错 Uncaught ReferenceError: jQuery is not defined

    layui 扩展外部模块 jstree 报此错误

    查找原因发现,jquery 已经引入进来,但是 jstree 依赖 jQuery

    解决办法:

    在 jstree 文件最上方加上

    window.jQuery = layui.$;

    示例:

    /*! jsTree - v3.3.8 - 2019-04-29 - (MIT) */
    window.jQuery = layui.$;
    
    ... jsTree code ...
    
    layui.define(function(exports) {exports('jstree', {})});
  • 相关阅读:
    Vue中computed和watch的区别
    JS基础语法
    JDBC
    表设计
    查询语句
    反射
    网络端
    多线程
    HashMap
    IO
  • 原文地址:https://www.cnblogs.com/sirdong/p/12083403.html
Copyright © 2011-2022 走看看