index.js 877 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Component({
  2. options: {
  3. multipleSlots: true
  4. },
  5. properties: {
  6. show:{
  7. type: Boolean,
  8. observer: function (newVal){
  9. this.setData({
  10. show: newVal,
  11. showAnimation:newVal
  12. });
  13. }
  14. },
  15. height:{
  16. type: String,
  17. observer: function (newVal){
  18. if (newVal) {
  19. this.setData({ height: newVal });
  20. }
  21. }
  22. },
  23. FixHeight:{
  24. type: String,
  25. observer: function (newVal){
  26. if (newVal) {
  27. this.setData({ FixHeight: newVal });
  28. }
  29. }
  30. }
  31. },
  32. data: {
  33. show:false,
  34. showAnimation:false,
  35. height:'100%',
  36. minHeight:'0'
  37. },
  38. methods: {
  39. close(){
  40. this.setData({showAnimation:false})
  41. setTimeout(() => {
  42. this.setData({ show: false });
  43. this.triggerEvent("close", this.data.show);
  44. }, 300);
  45. }
  46. }
  47. })