index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // components/My_showModel/index.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. isShow: {
  8. type: Boolean,
  9. value: false
  10. },
  11. /* 标题 */
  12. title: {
  13. type: String,
  14. value: "提示"
  15. },
  16. /* 内容 */
  17. content: {
  18. type: String
  19. },
  20. /* 确定按钮 */
  21. confirm: {
  22. type: String,
  23. value: "确定"
  24. },
  25. /* 取消按钮 */
  26. cancel: {
  27. type: String,
  28. value: "取消"
  29. },
  30. /* 隐藏取消按钮 */
  31. hideCancel: {
  32. type: Boolean,
  33. value: false
  34. },
  35. /* 按钮回调 */
  36. callBack: {
  37. type: Function
  38. }
  39. },
  40. /**
  41. * 组件的初始数据
  42. */
  43. data: {
  44. },
  45. /**
  46. * 组件的方法列表
  47. */
  48. methods: {
  49. catchtouchmove() {},
  50. butClick(e) {
  51. const {
  52. value
  53. } = e.target.dataset;
  54. if (value == undefined) return;
  55. this.setData({
  56. isShow: false
  57. });
  58. this.triggerEvent('callBack', value);
  59. },
  60. }
  61. })