electricity_bill_calc_wx/components/picker/index.js

32 lines
506 B
JavaScript

// components/picker/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
valueKey: {
type: String,
default: "name"
},
show: Boolean,
columns: Array,
type: String,
title: String,
},
/**
* 组件的方法列表
*/
methods: {
onClose() {
this.triggerEvent("close");
},
confirm(e) {
this.triggerEvent("ok", {...e.detail, type: this.data.type})
},
cancel() {
this.triggerEvent("cancel")
}
}
})