MCPcopy
hub / github.com/youzan/vant-weapp / trigger

Function trigger

packages/tabs/index.ts:138–148  ·  view source on GitHub ↗
(eventName: string, child?: TrivialInstance)

Source from the content-addressed store, hash-verified

136 },
137
138 trigger(eventName: string, child?: TrivialInstance) {
139 const { currentIndex } = this.data;
140
141 const data = this.getChildData(currentIndex, child);
142
143 if (!isDef(data)) {
144 return;
145 }
146
147 this.$emit(eventName, data);
148 },
149
150 onTap(event: WechatMiniprogram.TouchEvent) {
151 const { index } = event.currentTarget.dataset;

Callers

nothing calls this directly

Calls 1

isDefFunction · 0.90

Tested by

no test coverage detected