如果在wind输出错误:
EXML解析错误 <皮肤名称>: 无法将'string'类型的值赋给属性:'属性名称:'
at <自定义皮肤组件 skinName="皮肤名" horizontalCenter="0" verticalCenter="0" id="_SBubbleUI1"/>
则说明你在自定义皮肤里面声明变量的时候赋值了;
例如:我自定义了一个MyButton组件,MyButton.ts代码:
class MyButton extends eui.Button {
public defaultLabel = 'hello world!';
public constructor() {
super();
this.skinName = MyButtonSkin;
}
}
然后在其他皮肤里面引用MyButton这个自定义组件的时候就会报错---------EXML解析错误
这个时候不能在声明的时候赋值: public defaultLabel = ‘hello world!’;所以应该改成:
class MyButton extends eui.Button {
public defaultLabel;
public constructor() {
super();
this.defaultLabel = 'hello world!'
this.skinName = MyButtonSkin;
}
}