Explorar o código

getSystemInfoSync过期改为getWindowInfo

萤火科技 hai 1 ano
pai
achega
36db02a18a
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      components/page/diyComponents/banner/index.vue
  2. 1 1
      utils/util.js

+ 1 - 1
components/page/diyComponents/banner/index.vue

@@ -37,7 +37,7 @@
       }
     },
     created() {
-      const { windowWidth } = uni.getSystemInfoSync()
+      const { windowWidth } = uni.getWindowInfo()
       this.windowWidth = windowWidth > 750 ? 750 : windowWidth
     },
     methods: {

+ 1 - 1
utils/util.js

@@ -206,7 +206,7 @@ export const arrayIntersect = (array1, array2) => {
  * @return {Number}
  */
 export const rpx = () => {
-  const { windowWidth } = uni.getSystemInfoSync()
+  const { windowWidth } = uni.getWindowInfo()
   // #ifdef H5
   // 与pages.json文件中的 rpxCalcMaxDeviceWidth参数对应, 请勿修改
   const rpxCalcMaxDeviceWidth = 750