Browse Source

fix(usetarorect): method modification import

Drjingfubo 3 years ago
parent
commit
d5477faa15
3 changed files with 4 additions and 5 deletions
  1. 1 1
      package.json
  2. 1 1
      publish/nutui-taro/package.json
  3. 2 3
      src/packages/utils/useTaroRect/index.ts

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@nutui/nutui",
-  "version": "4.0.2",
+  "version": "4.0.3-beta.0",
   "description": "京东风格的轻量级移动端 Vue2、Vue3 组件库(支持小程序开发)",
   "main": "dist/nutui.umd.js",
   "module": "dist/nutui.es.js",

+ 1 - 1
publish/nutui-taro/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@nutui/nutui-taro",
-  "version": "4.0.2",
+  "version": "4.0.3-beta.0",
   "description": "京东风格的轻量级移动端 Vue2、Vue3 组件库(支持小程序开发)",
   "main": "dist/nutui.umd.js",
   "module": "dist/nutui.es.js",

+ 2 - 3
src/packages/utils/useTaroRect/index.ts

@@ -7,7 +7,7 @@
   right	右侧与视图窗口左上角的距离	number
   bottom	底部与视图窗口左上角的距离	number
  */
-
+import Taro from '@tarojs/taro';
 import { Ref, unref } from 'vue';
 function isWindow(val: unknown): val is Window {
   return val === window;
@@ -22,9 +22,8 @@ export interface rectTaro {
   height: number;
 }
 
-export const useTaroRect = (elementRef: (Element | Window | any) | Ref<Element | Window | any>, Taro: any): any => {
+export const useTaroRect = (elementRef: (Element | Window | any) | Ref<Element | Window | any>, taro: any): any => {
   let element = unref(elementRef);
-  console.log(Taro.getEnv());
   return new Promise((resolve) => {
     if (Taro.getEnv() === 'WEB') {
       if (element && element.$el) {