浏览代码

Merge branch 'v4' of https://github.com/jdf2e/nutui into v4

Drjingfubo 3 年之前
父节点
当前提交
d01db73401

+ 2 - 5
publish/nutui-taro/package.json

@@ -44,13 +44,10 @@
     "publish:beta": "npm publish --tag=beta",
     "publish:beta": "npm publish --tag=beta",
     "publish:latest": "npm publish"
     "publish:latest": "npm publish"
   },
   },
-  "standard-version": {
-    "scripts": {
-      "postchangelog": "node ./jd/updateChangelog.js"
-    }
+  "peerDependencies":{
+    "@nutui/icons-vue-taro": "^0.0.9"
   },
   },
   "dependencies": {
   "dependencies": {
-    "@nutui/icons-vue-taro": "^0.0.9",
     "sass": "^1.50.0"
     "sass": "^1.50.0"
   },
   },
   "devDependencies": {},
   "devDependencies": {},

+ 3 - 1
publish/nutui/package.json

@@ -37,8 +37,10 @@
     "publish:beta": "npm publish --tag=beta",
     "publish:beta": "npm publish --tag=beta",
     "publish:latest": "npm publish"
     "publish:latest": "npm publish"
   },
   },
+  "peerDependencies":{
+    "@nutui/icons-vue": "^0.0.25"
+  },
   "dependencies": {
   "dependencies": {
-    "@nutui/icons-vue": "^0.0.24",
     "sass": "^1.50.0"
     "sass": "^1.50.0"
   },
   },
   "devDependencies": {},
   "devDependencies": {},

+ 3 - 2
src/packages/__VUE/collapse/index.taro.vue

@@ -34,9 +34,8 @@ export default create({
     };
     };
 
 
     const changeValAry = (name: string) => {
     const changeValAry = (name: string) => {
-      const activeItem: any = props.modelValue instanceof Object ? Object.values(props.modelValue) : props.modelValue;
+      const activeItem: any = props.modelValue;
       let index = -1;
       let index = -1;
-
       activeItem.forEach((item: string | number, idx: number) => {
       activeItem.forEach((item: string | number, idx: number) => {
         if (String(item) == String(name)) {
         if (String(item) == String(name)) {
           index = idx;
           index = idx;
@@ -84,6 +83,8 @@ export default create({
           let domsProps: any = slots?.default?.();
           let domsProps: any = slots?.default?.();
           let doms: any = childrenDom.value;
           let doms: any = childrenDom.value;
           Array.from(doms).forEach((item: any, index: number) => {
           Array.from(doms).forEach((item: any, index: number) => {
+            console.log(index);
+
             if (typeof newval == 'number' || typeof newval == 'string') {
             if (typeof newval == 'number' || typeof newval == 'string') {
               if (domsProps[index] && domsProps[index].props) {
               if (domsProps[index] && domsProps[index].props) {
                 item.changeOpen(newval == domsProps[index].props.name ? true : false);
                 item.changeOpen(newval == domsProps[index].props.name ? true : false);

+ 17 - 7
src/packages/__VUE/collapseitem/index.taro.vue

@@ -156,11 +156,12 @@ export default create({
     };
     };
     const open = () => {
     const open = () => {
       proxyData.openExpanded = !proxyData.openExpanded;
       proxyData.openExpanded = !proxyData.openExpanded;
-      // let time = contentRef.value.childNodes?.length || 1;
-      setTimeout(() => {
-        animation();
-      }, 700);
-      // }, 500 * time);
+      setTimeout(
+        () => {
+          animation();
+        },
+        init.value ? 500 : 0
+      );
     };
     };
 
 
     const defaultOpen = () => {
     const defaultOpen = () => {
@@ -214,7 +215,9 @@ export default create({
         if (tm && tm.length > 0) {
         if (tm && tm.length > 0) {
           let h = tm[0]['height'];
           let h = tm[0]['height'];
           item1.conHeight = h;
           item1.conHeight = h;
-          // resetHeight(h);
+          setTimeout(() => {
+            init.value && handleOpen();
+          }, 500);
         }
         }
       });
       });
     };
     };
@@ -224,6 +227,9 @@ export default create({
         let ary: any = Array.from(item1.$el.children);
         let ary: any = Array.from(item1.$el.children);
         let h = ary[1].children[0]['offsetHeight'];
         let h = ary[1].children[0]['offsetHeight'];
         item1.conHeight = h;
         item1.conHeight = h;
+        setTimeout(() => {
+          init.value && handleOpen();
+        }, 500);
       });
       });
     };
     };
 
 
@@ -239,7 +245,7 @@ export default create({
         }
         }
       });
       });
     };
     };
-    onMounted(() => {
+    const handleOpen = () => {
       const { name } = props;
       const { name } = props;
       const active = parent && parent.props.modelValue;
       const active = parent && parent.props.modelValue;
       if (typeof active == 'number' || typeof active == 'string') {
       if (typeof active == 'number' || typeof active == 'string') {
@@ -252,6 +258,10 @@ export default create({
           defaultOpen();
           defaultOpen();
         }
         }
       }
       }
+      init.value = false;
+    };
+    const init = ref(true);
+    onMounted(() => {
       // 获取 DOM 元素
       // 获取 DOM 元素
       if (Taro.getEnv() === 'WEB') {
       if (Taro.getEnv() === 'WEB') {
         getRefHeight();
         getRefHeight();

+ 1 - 1
src/packages/__VUE/price/doc.en-US.md

@@ -96,7 +96,7 @@ Three sizes are supported: small, normal, and large, and the default is normal.
 | decimal-digits | Decimal digits                                             | number | `2`      |
 | decimal-digits | Decimal digits                                             | number | `2`      |
 | thousands      | Thousands separation                                       | boolean          | `false`  |
 | thousands      | Thousands separation                                       | boolean          | `false`  |
 | position       | The symbol appear before or after the price,`before`、`after` | string           | `before` |
 | position       | The symbol appear before or after the price,`before`、`after` | string           | `before` |
-| size           | Size,`small`、`normal`、`large`                | string           | `large` |
+| size           | Size,`small`、`normal`、`large`                | string           | `normal` |
 
 
 ## Theming
 ## Theming
 
 

+ 1 - 1
src/packages/__VUE/price/doc.md

@@ -98,7 +98,7 @@ app.use(Price);
 | decimal-digits | 小数位位数                              | number  | `2`     |
 | decimal-digits | 小数位位数                              | number  | `2`     |
 | thousands      | 是否按照千分号形式显示                    | boolean          | `false`  |
 | thousands      | 是否按照千分号形式显示                    | boolean          | `false`  |
 | position       | 符号显示在价格前或者后,`before`、`after`  | string           | `before` |
 | position       | 符号显示在价格前或者后,`before`、`after`  | string           | `before` |
-| size           | 价格尺寸,`small`、`normal`、`large`     | string           | `large` |
+| size           | 价格尺寸,`small`、`normal`、`large`     | string           | `normal` |
 
 
 
 
 ## 主题定制
 ## 主题定制

+ 1 - 1
src/packages/__VUE/price/doc.taro.md

@@ -95,7 +95,7 @@ app.use(Price);
 | decimal-digits | 小数位位数                              | number  | `2`     |
 | decimal-digits | 小数位位数                              | number  | `2`     |
 | thousands      | 是否按照千分号形式显示                    | boolean          | `false`  |
 | thousands      | 是否按照千分号形式显示                    | boolean          | `false`  |
 | position       | 符号显示在价格前或者后,`before`、`after`  | string           | `before` |
 | position       | 符号显示在价格前或者后,`before`、`after`  | string           | `before` |
-| size           | 价格尺寸,`small`、`normal`、`large`     | string           | `large` |
+| size           | 价格尺寸,`small`、`normal`、`large`     | string           | `normal` |
 
 
 ## 主题定制
 ## 主题定制
 
 

+ 2 - 0
src/packages/__VUE/textarea/index.scss

@@ -59,5 +59,7 @@
     top: -999999px;
     top: -999999px;
     left: -999999px;
     left: -999999px;
     font-size: 14px;
     font-size: 14px;
+    line-height: 1.5;
+    font-family: monospace;
   }
   }
 }
 }

+ 4 - 2
src/packages/__VUE/textarea/index.taro.vue

@@ -155,7 +155,7 @@ export default create({
     };
     };
 
 
     const textareaRef = ref<any>(null);
     const textareaRef = ref<any>(null);
-    const textareaHeight = ref();
+    const textareaHeight = ref(20);
     const heightSet = ref('auto');
     const heightSet = ref('auto');
     const getContentHeight = () => {
     const getContentHeight = () => {
       heightSet.value = 'auto';
       heightSet.value = 'auto';
@@ -216,7 +216,9 @@ export default create({
         if (res[0] && textareaRef.value) {
         if (res[0] && textareaRef.value) {
           let _item: any = Array.from(res[0]).filter((item: any) => item.id == uid);
           let _item: any = Array.from(res[0]).filter((item: any) => item.id == uid);
           if (_item[0]) {
           if (_item[0]) {
-            textareaHeight.value = _item[0]['height'] || 20;
+            if (Taro.getEnv() !== Taro.ENV_TYPE.WEAPP) {
+              textareaHeight.value = _item[0]['height'] || 20;
+            }
             copyTxtStyle.value.width = _item[0]['width'] + 'px';
             copyTxtStyle.value.width = _item[0]['width'] + 'px';
           }
           }
           nextTick(getContentHeight);
           nextTick(getContentHeight);

+ 0 - 6
src/sites/mobile-taro/vue/src/exhibition/pages/collapse/index.vue

@@ -66,12 +66,6 @@ export default {
     const change = (name: string) => {
     const change = (name: string) => {
       console.log(`点击了name是${name}的面板`);
       console.log(`点击了name是${name}的面板`);
     };
     };
-    // const content = ref("");
-    // onMounted(() => {
-    //   setTimeout(() => {
-    //     content.value = "京东到家:教师节期间 创意花束销量增长53倍";
-    //   }, 500);
-    // })
     return {
     return {
       change,
       change,
       ...toRefs(data),
       ...toRefs(data),