index.js 844 B

12345678910111213141516171819202122232425262728293031323334353637
  1. const getHeight = require("../../utils/getHeight");
  2. Component({
  3. properties: {
  4. show: {
  5. type: Boolean
  6. },
  7. handle: {
  8. type: Function
  9. }, //按钮回调函数
  10. zIndex: {
  11. type: String,
  12. value: 99999,
  13. },
  14. },
  15. lifetimes: {
  16. attached() {
  17. getApp().globalData.Language.getLanguagePackage(this)
  18. },
  19. ready() {
  20. getHeight.getHeight('.head', this).then(res => this.setData({
  21. listHeight: res - 80
  22. }));
  23. }
  24. },
  25. methods: {
  26. onClick(e) {
  27. const {
  28. name
  29. } = e.target.dataset;
  30. if (name) this.triggerEvent("handle", name)
  31. },
  32. onClose() {
  33. this.triggerEvent("handle", "close")
  34. }
  35. }
  36. })