Files
electricity_bill_calc_wx/components/Segmented/index.js
2025-09-16 17:35:49 +08:00

31 lines
473 B
JavaScript

// components/Segmented/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
list: Array,
active: Number,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
handleChange(e) {
const { index } = e.currentTarget.dataset;
if (index === this.data.active) {
return;
}
this.triggerEvent("change", { index, name: this.data.list[index] })
}
}
})