代码之家  ›  专栏  ›  技术社区  ›  lukaszkups

jquery.verto不是构造函数

  •  0
  • lukaszkups  · 技术社区  · 8 年前

    我用的是 Verto library 在基于Vue CLI的项目中-我已将所有必需的文件复制到 static 文件夹并将其作为文件直接导入到我的 index.html 文件-类似于:

    <script src="static/js/jquery.min.js"></script> // I've also tried with including jQuery in webpack config, but with the same result
    <script src="static/js/jquery.json.min.js"></script>
    <script src="static/js/jquery.verto.js"></script>
    <script src="static/js/jquery.FSRTC.js"></script>
    <script src="static/js/jquery.jsonrpcclient.js"></script>
    

    在我的组件的方法中,我有这样的东西:

    connectAudio () {
      /* eslint-disable new-cap */
      const verto = new jQuery.verto({
      ...
    

    但一旦我执行它,就会收到一个错误: "TypeError: jQuery.verto is not a constructor"

    有人能帮我吗?

    1 回复  |  直到 8 年前
        1
  •  1
  •   Victor Torres    8 年前

    new jQuery.verto({}) 根据文档建议,在Verto Init回调中。

    $.verto.init({}, function(){ ... new jQuery.verto({...}) ... }) .

    推荐文章
    Brock  ·  Vue-Vue CLI-API变量
    9 年前