// component/actionSheet/actionSheet.js Component({ /** * 组件的属性列表 */ properties: { value:{ type: Array, value: [] } }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { // 点击取消 cancel() { this.triggerEvent('cancel', {}, {}); }, // 点击选择 click(e) { let index = e.currentTarget.dataset.index; this.triggerEvent('selected', this.data.value[index], {}); }, // 禁止背景滚动 unMove() { return; } } })