index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Component({
  2. options: {
  3. addGlobalClass: true,
  4. multipleSlots: true, // 在组件定义时的选项中启用多slot支持
  5. },
  6. properties: {
  7. show: {
  8. type: Boolean,
  9. value: false,
  10. },
  11. value: {
  12. type: String,
  13. value: '',
  14. },
  15. title: {
  16. type: String,
  17. observer(newVal) {
  18. this.setData({ 'goods.title': newVal });
  19. },
  20. },
  21. price: {
  22. type: String,
  23. value: '',
  24. observer(newVal) {
  25. this.setData({ 'goods.price': newVal });
  26. },
  27. },
  28. thumb: {
  29. type: String,
  30. value: '',
  31. observer(newVal) {
  32. this.setData({ 'goods.thumb': newVal });
  33. },
  34. },
  35. thumbMode: {
  36. type: String,
  37. value: 'aspectFit',
  38. },
  39. zIndex: {
  40. type: Number,
  41. value: 99,
  42. },
  43. specs: {
  44. type: Array,
  45. value: [],
  46. },
  47. },
  48. data: {
  49. goods: {
  50. title: '',
  51. thumb: '',
  52. price: '',
  53. hideKey: {
  54. originPrice: true,
  55. tags: true,
  56. specs: true,
  57. num: true,
  58. },
  59. },
  60. },
  61. methods: {
  62. onClose() {
  63. this.triggerEvent('close');
  64. },
  65. onCloseOver() {
  66. this.triggerEvent('closeover');
  67. },
  68. },
  69. });