Uncaught TypeError: Cannot read property ‘toString’ of undefined
at cc_Label.set [as string]
set (value) {
let oldValue = this._string;
this._string = value.toString();
if (this.string !== oldValue) {
this._updateRenderData();
}
this._checkStringEmpty();
},
大致就是在定位在toString的时候
创建时
let lbl =node.getComponent(cc.Label).string
或者.getComponent(cc.Label).string = “str”
你的节点应该没有cc.Label组件,请确认下!