我们有 swatch-renderer.js
此文件中有一些小部件。
....
    $.widget('mage.SwatchRenderer', {
....
    /**
     * @private
     */
    _init: function () {
        if (this.options.jsonConfig !== '' && this.options.jsonSwatchConfig !== '') {
            this._sortAttributes();
            this._RenderControls();
        } else {
            console.log('SwatchRenderer: No input data received');
        }
    },
    /**
     * @private
     */
    _sortAttributes: function () {
        this.options.jsonConfig.attributes = _.sortBy(this.options.jsonConfig.attributes, function (attribute) {
            return attribute.position;
        });
    },
我想重写它的一些功能。
正确的做法是什么?
magento库中的解释不再实际,它们链接在使用另一种方法的类上(我说的是place-order.js / place-order-mixin.js)。所描述的示例并未以任何方式解释如何重写窗口小部件功能。