Composer-view.js文件出错

Composer-view.js file gives me an error

本文关键字:出错 文件 js Composer-view      更新时间:2023-09-26

我收到这个错误。composer-view.js?ver=4.5.3:6未捕获类型错误:无法读取未定义的属性"attributes"。

我在更改代码后得到了这个。

html2element: function(html) {
        var $template, attributes = {},
            template = html;
        $template = $(template(this.model.toJSON()).trim()), _.each($template.get(0).attributes, function(attr) {
            attributes[attr.name] = attr.value}), 
            this.$el.attr(attributes).html($template.html()), this.setContent(), 
            this.renderContent()
    },

正因为如此,我无法在我的视觉作曲家的后端视觉合成器编辑器中添加更新或删除。我使用的是VC-4.8.4

我使用的是Visual Composer 4.5.8,我认为它与wordpress 4.5不兼容。

为了解决一个问题,我将我的可视化编辑器更新为4.11.2.1。我认为是最新的,现在效果很好。

我已经参考了这个链接。Wordpress支持链接,描述插件问题

您的变量$template未定义

var $template; // undefined
...
_.each($template.get(0)....) // $template is still undefined