Browse Source

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

Drjnigfubo 3 years ago
parent
commit
789eb826a1

+ 1 - 1
src/packages/__VUE/checkboxgroup/index.vue

@@ -31,7 +31,7 @@ export default create({
       }
     };
 
-    const updateValue = (value: any[]) => {
+    const updateValue = (value: string[]) => {
       emit('update:modelValue', value);
       emit('change', value);
     };

+ 2 - 2
src/packages/__VUE/elevator/index.taro.vue

@@ -93,7 +93,7 @@ export default create({
     }
   },
   emits: ['click-item', 'click-index'],
-  setup(props: any, context: any) {
+  setup(props, context) {
     const spaceHeight = 23;
     const listview: Ref<HTMLElement> = ref() as Ref<HTMLElement>;
     const state = reactive({
@@ -154,7 +154,7 @@ export default create({
       state.listHeight.push(height);
       for (let i = 0; i < state.listGroup.length; i++) {
         state.query.selectAll(`.elevator__item__${i}`).boundingClientRect();
-        state.query.exec((res: any) => {
+        state.query.exec((res) => {
           height += res[i][0].height;
           state.listHeight.push(height);
         });

+ 1 - 1
src/packages/__VUE/elevator/index.vue

@@ -78,7 +78,7 @@ export default create({
     }
   },
   emits: ['click-item', 'click-index'],
-  setup(props: any, context: any) {
+  setup(props, context) {
     const listview: Ref<any> = ref(null);
     const state = reactive({
       anchorIndex: 0,

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

@@ -259,7 +259,7 @@ Scrolling to the bottom of the list automatically loads more data.
 | is-open-refresh  | Enable pull refresh                                                                                                | Boolean | `false`          |
 | pull-icon        | Pull refresh[图标名称](#/icon)                                                                                       | String  | <img src="https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png" width=40/>                |
 | pull-txt         | Pull refresh text                                                                                                   | String  |`Loose to refresh`|
-| load-icon        | Pull on loading[图标名称](#/icon)                                                                                    | Boolean | <img src="https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png" width=40 />                |
+| load-icon        | Pull on loading[图标名称](#/icon)                                                                                    | String | <img src="https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png" width=40 />                |
 | load-txt         | Pull on loading text                                                                                                | String  | `Loading...`      |
 
 ### Events

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

@@ -254,7 +254,7 @@
 | is-open-refresh        | 是否开启下拉刷新                         | Boolean | `false`                |
 | pull-icon        | 下拉刷新[图标名称](#/icon)                        | String | <img src="https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png" width=40/>                |
 | pull-txt        | 下拉刷新提示文案                         | String | `松手刷新`                |
-| load-icon        | 上拉加载[图标名称](#/icon)                       | Boolean | <img src="https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png" width=40 />                |
+| load-icon        | 上拉加载[图标名称](#/icon)                       | String | <img src="https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png" width=40 />                |
 | load-txt        | 上拉加载提示文案                         | String | `加载中...`                |
 
 ### Events

+ 3 - 9
src/packages/__VUE/sidenavbar/index.vue

@@ -19,7 +19,7 @@ export default create({
     }
   },
   emits: [],
-  setup: (props: any, context: any) => {
+  setup: (props) => {
     const list = ref(null) as Ref;
     const state = reactive({
       count: 1,
@@ -33,10 +33,10 @@ export default create({
       };
     });
 
-    const setPaddingLeft = (nodeList: any, level: number = 1) => {
+    const setPaddingLeft = (nodeList: any[], level: number = 1) => {
       for (let i = 0; i < nodeList.length; i++) {
         let item = nodeList[i];
-        item.children[0].style.paddingLeft = props.offset * level + 'px';
+        item.children[0].style.paddingLeft = +props.offset * level + 'px';
         if (!item.className.includes('nut-sidenavbaritem')) {
           setPaddingLeft(Array.from(item.children[1].children), ++state.count);
         }
@@ -71,12 +71,6 @@ export default create({
       });
     });
 
-    // watch(context.slots?.default(), () => {
-    //   console.log(123)
-    //   state.count = 1;
-    //   handleSlots();
-    // });
-
     return {
       ...toRefs(state),
       list,

+ 1 - 0
src/sites/mobile-taro/vue/config/index.js

@@ -25,6 +25,7 @@ const config = {
     options: {}
   },
   framework: 'vue3',
+  compiler: 'webpack5',
   mini: {
     postcss: {
       pxtransform: {

+ 20 - 17
src/sites/mobile-taro/vue/package.json

@@ -37,29 +37,32 @@
   "dependencies": {
     "@babel/runtime": "^7.7.7",
     "@nutui/nutui-taro": "^3.1.18",
-    "@tarojs/components": "3.4.14",
-    "@tarojs/mini-runner": "3.4.14",
-    "@tarojs/runtime": "3.4.14",
-    "@tarojs/taro": "3.4.14",
-    "vue": "3.2.37"
+    "@tarojs/components": "^3.4.14",
+    "@tarojs/mini-runner": "^3.4.14",
+    "@tarojs/runtime": "^3.4.14",
+    "@tarojs/taro": "^3.4.14",
+    "vue": "^3.2.37"
   },
   "devDependencies": {
     "@babel/core": "^7.8.0",
-    "@tarojs/cli": "3.4.14",
-    "@tarojs/mini-runner": "3.4.14",
-    "@tarojs/plugin-framework-vue3": "3.4.14",
-    "@tarojs/plugin-html": "3.4.14",
-    "@tarojs/webpack-runner": "3.4.14",
+    "@tarojs/cli": "^3.5.4",
+    "@vue/babel-plugin-jsx": "^1.0.6",
+    "@tarojs/mini-runner": "^3.5.4",
+    "@tarojs/plugin-framework-vue3": "^3.5.4",
+    "@tarojs/plugin-html": "^3.5.4",
+    "webpack": "^5.69.0",
+    "@tarojs/webpack5-runner": "^3.5.4",
     "@types/webpack-env": "^1.13.6",
     "@typescript-eslint/eslint-plugin": "^4.15.1",
     "@typescript-eslint/parser": "^4.15.1",
-    "@vue/compiler-sfc": "3.2.34",
-    "babel-preset-taro": "3.2.10",
-    "eslint": "^6.8.0",
-    "eslint-config-taro": "3.2.10",
-    "eslint-plugin-vue": "^7.0.0",
-    "stylelint": "9.3.0",
-    "typescript": "4.6.4",
+    "@vue/compiler-sfc": "^3.0.0",
+    "babel-preset-taro": "^3.5.4",
+    "eslint": "^8.12.0",
+    "eslint-plugin-vue": "^8.0.0",
+    "eslint-config-taro": "^3.5.4",
+    "stylelint": "^9.3.0",
+    "style-loader": "^1.3.0",
+    "typescript": "^4.6.4",
     "vue-loader": "^16.0.0-beta.8"
   }
 }

+ 1 - 1
src/sites/mobile-taro/vue/src/pages/index/index.vue

@@ -31,7 +31,7 @@
   </div>
 </template>
 
-<script>
+<script lang="ts">
 import { reactive, toRefs } from 'vue';
 import { nav } from '../../../../../../config.json';
 import Taro from '@tarojs/taro';