import { _decorator, Component, Node, Prefab, instantiate } from 'cc'; import { Holder } from '../adapter/abstract/Holder'; import { ContentType } from '../adapter/define/enum'; import { itemData } from '../config/ItemDataConfig'; import { qipan_shop_item } from './qipan_shop_item'; const { ccclass, property } = _decorator; @ccclass('shop_qipan_page') export class shop_qipan_page extends Component { start() { } update(deltaTime: number) { } show(holder:Holder,prefab:Prefab,list:itemData[],ct:ContentType){ this.node.removeAllChildren() for (let index = 0; index < list.length; index++) { const element = list[index]; var item = instantiate(prefab); this.node.addChild(item) item.getComponent(qipan_shop_item).show(element,ct) } } hide(){ } }