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