import { shortcut, Widget, deepClone, map, extend } from "@/core"; @shortcut() export class Func extends Widget { static xtype = "demo.loader"; props = { baseCls: "demo-func" }; render() { const self = this; this.all = 0; const items = deepClone(Demo.CONSTANTS.ITEMS); return { type: "bi.loader", itemsCreator(options, populate) { setTimeout(() => { populate( map(items.slice((options.times - 1) * 10, options.times * 10), (i, v) => extend(v, { type: "bi.single_select_item", height: 25, }) ) ); }, 1000); }, hasNext(options) { return options.times * 10 < items.length; }, }; } }