MCPcopy
hub / github.com/coderwhy/LearnMiniProgram / itemClick

Function itemClick

components/w-tab-control/w-tab-control.js:24–33  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

22 */
23 methods: {
24 itemClick(e) {
25 // 1.设置最新的index
26 this.setData({
27 currentIndex: e.currentTarget.dataset.index
28 })
29
30 // 2.发出时间
31 const data = {index: this.data.currentIndex}
32 this.triggerEvent("tabclick", data, {})
33 }
34 }
35})

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected