import { _decorator , Component , Label } from "cc" ; const { ccclass , property } = _decorator ; @ ccclass ( "ListItem" ) export default class ListItem extends Component { @ property ( Label ) label : Label | null = null ; start ( ) { } private _clickCallBack : VoidFunction ; init ( name , clickCallBack ) { this . label . string = name ; this . _clickCallBack = clickCallBack ; } onClick ( ) { this . _clickCallBack ( ) ; } }