|
@@ -1,37 +1,22 @@
|
|
|
-// components/My_listBox/index.js
|
|
|
-
|
|
|
+import {
|
|
|
+ getHeight
|
|
|
+} from "../../utils/GetRheRemainingHeight";
|
|
|
Component({
|
|
|
- /**
|
|
|
- * 组件的属性列表
|
|
|
- */
|
|
|
properties: {
|
|
|
- height: {
|
|
|
- type: Number,
|
|
|
- value: 0
|
|
|
- },
|
|
|
- getlist: {
|
|
|
- type: Function
|
|
|
+ height: Number, //组件高度
|
|
|
+ getlist: Function,
|
|
|
+ pullDown: { //是否开启下拉
|
|
|
+ type: Boolean,
|
|
|
+ value: true
|
|
|
},
|
|
|
- pullDown: {
|
|
|
+ safety: { //适配苹果底部安全距离
|
|
|
type: Boolean,
|
|
|
value: true
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- lifetimes: {
|
|
|
- ready() {}
|
|
|
+ },
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 组件的初始数据
|
|
|
- */
|
|
|
data: {
|
|
|
- inRefresh: false
|
|
|
+ inRefresh: false, //下拉开启自定义项
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 组件的方法列表
|
|
|
- */
|
|
|
methods: {
|
|
|
/* 下拉刷新 */
|
|
|
pullToRefresh() {
|
|
@@ -52,5 +37,13 @@ Component({
|
|
|
loadThePage() {
|
|
|
this.triggerEvent("getlist", false)
|
|
|
},
|
|
|
+ /* 设置组件高度 */
|
|
|
+ setHeight(element, that) {
|
|
|
+ getHeight(element, that).then(res => {
|
|
|
+ if (this.data.height != res) this.setData({
|
|
|
+ height: res
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
})
|