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