actionsheet.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Component({
  2. externalClasses: ['tui-actionsheet-class'],
  3. properties: {
  4. //点击遮罩 是否可关闭
  5. maskClosable: {
  6. type: Boolean,
  7. value: true
  8. },
  9. //显示操作菜单
  10. show: {
  11. type: Boolean,
  12. value: false
  13. },
  14. //菜单按钮数组,自定义文本颜色,红色参考色:#e53a37
  15. itemList: {
  16. type: Array,
  17. value: [{
  18. text: "确定",
  19. color: "#1a1a1a"
  20. }]
  21. },
  22. //提示文字
  23. tips: {
  24. type: String,
  25. value: ""
  26. },
  27. //提示文字颜色
  28. color: {
  29. type: String,
  30. value: "#9a9a9a"
  31. },
  32. ////提示文字大小
  33. size: {
  34. type: Number,
  35. value: 26
  36. },
  37. //是否需要取消按钮
  38. isCancel:{
  39. type:Boolean,
  40. value:true
  41. }
  42. },
  43. data: {
  44. },
  45. methods: {
  46. handleClickMask() {
  47. if (!this.data.maskClosable) return;
  48. this.handleClickCancel();
  49. },
  50. handleClickItem(e) {
  51. if (!this.data.show) return;
  52. const dataset = e.currentTarget.dataset;
  53. this.triggerEvent('click', {
  54. index: dataset.index
  55. });
  56. },
  57. handleClickCancel() {
  58. this.triggerEvent('cancel');
  59. }
  60. }
  61. })