Visual composer doesn't load and gives TypeError: _.template(…).trim is not a function

前端 未结 11 1377
孤街浪徒
孤街浪徒 2021-02-05 11:07

My visual composer plugin doesn\'t work. It stuck on the loading page. And it gives an error \"TypeError: .template(...).trim is not a function\" Error is on this line of co

11条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 11:45

    As Shady sherif said at Maulik's suggestion, this is what I've changed in 2 places at frontend-editor.min.js and it worked!! Thanks to you both!

    Change this:

    this.$controls=$(_.template(template,data,_.extend({},vc.template_options,{ evaluate:/\{#([\s\S]+?)#}/g})).trim()).addClass("vc_controls");  
    

    With this:

    this.$controls=$(("vc.template_options").trim()).addClass("vc_controls");
    

提交回复
热议问题