瀏覽代碼

增加全局属性mixin

htc 1 年之前
父節點
當前提交
62b229a7df
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      main.js

+ 3 - 4
main.js

@@ -45,10 +45,9 @@ Vue.component('Tabbar', Tabbar);
 //全局分享当前页(带参数)
 import wxShare from '@/utils/wxShare.js'
 Vue.mixin(wxShare);
-
-//设置全局页面自适应高度和上边距
-Vue.prototype.$h = uni.getSystemInfoSync().windowHeight;
-Vue.prototype.$mt = uni.getSystemInfoSync().statusBarHeight + 44;
+//全局属性
+import getSystemInfo from '@/utils/getSystemInfo.js'
+Vue.mixin(getSystemInfo);
 
 // #ifdef VUE3
 import {