index.js 956 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Component({
  2. options: {
  3. addGlobalClass: true
  4. },
  5. properties: {
  6. iconName: {
  7. type: String,
  8. value: "icon-feiyongleixing"
  9. },
  10. title: {
  11. type: String,
  12. },
  13. showText: {
  14. type: String,
  15. },
  16. placeholder: {
  17. type: String,
  18. value: "请选择"
  19. },
  20. isClear: {
  21. type: Boolean,
  22. value: false
  23. },
  24. clearCallBack: {
  25. type: Function
  26. }
  27. },
  28. data: {},
  29. methods: {
  30. clearResults() {
  31. let that = this;
  32. wx.showModal({
  33. title: '提示',
  34. content: '是否确定清空选择项',
  35. complete: (res) => {
  36. if (res.confirm) {
  37. that.triggerEvent("clearCallBack", that.data.title)
  38. }
  39. }
  40. })
  41. }
  42. }
  43. })