index.js 619 Bytes
// components/actionSheet/index.js
import util from '../../utils/util';
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    items: Array,
  },

  /**
   * 组件的初始数据
   */
  data: {
    actionSheetHidden: true,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    show(){
      this.setData({
        actionSheetHidden: false,
      })
    },
    hide(){
      this.setData({
        actionSheetHidden: true,
      })
    },
    bindItemTap(e){
      this.triggerEvent('click',{...util.attr(e)});
      this.hide();
    },
    actionSheetChange(){
      this.hide();
    }
  }
})