任何人都可以解释一下,当我在原型函数中执行console.log(me)
以扩展时,我得到了here的article
属性,但是当我执行console.log(me.article)
时得到undefined
see here
任何帮助将不胜感激。谢谢
编辑:
var _createLeftElements = Shopware.apps.Article.view.detail.Base.prototype.createLeftElements;
Shopware.apps.Article.view.detail.Base.prototype.createLeftElements = function() {
var me =this, articleId = null, additionalText = null;
console.log(me);
console.log(me.article)
.
. // some code here
.
return [
me.supplierCombo,
me.nameField,
me.mainDetailAdditionalText,
me.numberField,
{
xtype: 'checkbox',
name: 'active',
fieldLabel: me.snippets.active,
inputValue: true,
uncheckedValue:false
},
{
xtype: 'checkbox',
name: 'isConfigurator',
fieldLabel: me.snippets.configurator.fieldLabel,
inputValue: true,
uncheckedValue:false
}
];
};
EDIT#2
已将此代码块放入函数中,并在文件末尾调用它。不知道这个细节是否重要,但只是想彻底。谢谢