const getHeight = require("../../utils/getRheRemainingHeight"); Component({ properties: { show: Boolean, handle: Function, //按钮回调函数 }, lifetimes: { ready() { getHeight.getHeight('.head', this).then(res => this.setData({ listHeight: res - 150 })); } }, methods: { onClick(e) { const { name } = e.target.dataset; if (name) this.triggerEvent("handle", name) }, onClose(){ this.triggerEvent("handle", "close") } } })