import { Item } from "../../../../ItemList/Item" ; import { Util } from "../../../../Common/Utils/Util" ; import { UserAttributeData } from "./UserAttributeData" ; const { ccclass , property } = cc . _decorator ; @ ccclass export default class UserAttributeItem extends Item < UserAttributeData > { private _data : UserAttributeData ; @ property ( cc . Label ) public attribute : cc . Label ; @ property ( cc . Label ) public amount : cc . Label ; getData ( ) { return this . _data ; } showByData ( ) { this . attribute . string = this . _data . attribute_ch ; this . amount . string = this . _data . amount . toString ( ) ; } bindData ( currentIndex , data ) { if ( data == null ) { this . reset ( currentIndex ) ; return ; } this . _data = data ; this . showByData ( ) ; } reset ( currentIndex ) { } select ( selected ) { if ( ! selected ) { return ; } } getClickButton ( ) { return this . getComponent ( cc . Button ) ; } }