import i18n from "../../../../i18n/i18n"; /** * 神卡属性 */ const {ccclass, property} = cc._decorator; @ccclass export default class CardAttrItem extends cc.Component { @property(cc.Label) mName: cc.Label = null; @property(cc.Label) mValue1: cc.Label = null; public init(name:string,v1:number,v2:number){ this.mName.string = i18n.t(name) let str = '+'+v1 if(v2 > 0){ str += '(+'+v2+')' } this.mValue1.string = str } }