index.js 616 B

12345678910111213141516171819202122232425
  1. const getHeight = require("../../utils/getRheRemainingHeight");
  2. Component({
  3. properties: {
  4. show: Boolean,
  5. handle: Function, //按钮回调函数
  6. },
  7. lifetimes: {
  8. ready() {
  9. getHeight.getHeight('.head', this).then(res => this.setData({
  10. listHeight: res - 180
  11. }));
  12. }
  13. },
  14. methods: {
  15. onClick(e) {
  16. const {
  17. name
  18. } = e.target.dataset;
  19. if (name) this.triggerEvent("handle", name)
  20. },
  21. onClose(){
  22. this.triggerEvent("handle", "close")
  23. }
  24. }
  25. })