checkpoint: pre-refactor state before fixing P0/P1 issues
This commit is contained in:
@@ -12,7 +12,8 @@ Component({
|
||||
|
||||
methods: {
|
||||
onTab(e: WechatMiniprogram.CustomEvent) {
|
||||
const index = e.currentTarget.dataset.index as number
|
||||
// dataset 取出的是字符串,必须转数字,否则 WXML 中 selected === n 严格比较失败
|
||||
const index = Number(e.currentTarget.dataset.index)
|
||||
const path = e.currentTarget.dataset.path as string
|
||||
if (index === this.data.selected) return
|
||||
this.setData({ selected: index })
|
||||
|
||||
Reference in New Issue
Block a user