【发布时间】:2020-05-22 11:34:36
【问题描述】:
在这里,我正在尝试使用 mixin 在我的模块中扩展 Amasty js 小部件。 我创建了如下所示的 requirejs-config.js 文件
var config = {
config: {
mixins: {
'amShopbyAjax': {
'vendor_CustomCatalog/js/amasty/amShopbyAjax-override': true
}
}
}
};
我已经创建了如下的js文件
define([
"jquery",
"jquery-ui-modules/widget"
], function ($) {
'use strict';
var amShopbyWidgetMixin = {
selectors: {
category_products_wrapper: '#amasty-shopby-category-product-list',
},
reloadHtml: function (data) {
console.log("Sdfsdfsdf");
return this._super();
},
callAjax: function (clearUrl, data, pushState, cacheKey, isSorting) {
console.log("sdnjkasndnsadj");
return this._super();
}
};
return function (targetWidget) {
$.widget('custom.amShopbyAjax', targetWidget, amShopbyWidgetMixin);
return $.custom.amShopbyAjax;
};
});
之后我运行 sudo bin/magento setup:static-content:deploy -f 并清除缓存,然后我收到“未捕获的 TypeError: base is not a constructor”错误
【问题讨论】:
标签: javascript jquery magento2