import { _decorator, Component, Node, Prefab, instantiate, Label } from 'cc'; import { Holder } from '../adapter/abstract/Holder'; import { itemData } from '../config/ItemDataConfig'; import { huobi_shop_item } from './huobi_shop_item'; import { jishiqi_shop_item } from './jishiqi_shop_item'; import { touxiangkuang_shop_item } from './touxiangkuang_shop_item'; const { ccclass, property } = _decorator; @ccclass('shop_huobi_page') export class shop_huobi_page extends Component { @property(Node) page_view:Node = null; @property(Node) lab_name:Node = null; start() { } update(deltaTime: number) { } show(prefab:Prefab,list:itemData[]){ this.page_view.removeAllChildren() this.lab_name.getComponent(Label).string = list[0].name for (let index = 0; index < list.length; index++) { const element = list[index]; var item = instantiate(prefab); this.page_view.addChild(item); item.getComponent(huobi_shop_item).show(element) } } hide(){ } }