Browse Source

fix: upd ts declaration errors

suzigang 3 years ago
parent
commit
ffbf216251

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

@@ -53,7 +53,7 @@
   </view>
 </template>
 <script lang="ts">
-import { computed, reactive, toRefs, nextTick, ref, Ref, watch } from 'vue';
+import { computed, reactive, toRefs, nextTick, ref, Ref, watch, PropType } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import { useExpose } from '@/packages/utils/useExpose/index';
 import { ElevatorData } from './type';
@@ -76,7 +76,7 @@ export default create({
       default: 'title'
     },
     indexList: {
-      type: Array,
+      type: Array as PropType<any[]>,
       default: () => {
         return [];
       }
@@ -142,7 +142,7 @@ export default create({
       return el.dataset.index as string;
     };
 
-    const setListGroup = (el: HTMLLIElement) => {
+    const setListGroup = (el: any) => {
       nextTick(() => {
         if (!state.listGroup.includes(el) && el != null) {
           state.listGroup.push(el);

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

@@ -39,7 +39,7 @@
   </view>
 </template>
 <script lang="ts">
-import { computed, reactive, toRefs, nextTick, ref, Ref, watch, onMounted } from 'vue';
+import { computed, reactive, toRefs, nextTick, ref, Ref, watch, onMounted, PropType } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import { useExpose } from '@/packages/utils/useExpose/index';
 import { ElevatorData } from './type';
@@ -56,7 +56,7 @@ export default create({
       default: 'title'
     },
     indexList: {
-      type: Array,
+      type: Array as PropType<any[]>,
       default: () => {
         return [];
       }
@@ -117,7 +117,7 @@ export default create({
       return el.getAttribute(prefix + name) as string;
     };
 
-    const setListGroup = (el: HTMLLIElement) => {
+    const setListGroup = (el: any) => {
       nextTick(() => {
         if (!state.listGroup.includes(el) && el != null) {
           state.listGroup.push(el);

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

@@ -16,7 +16,7 @@
   </Nut-Scroll-View>
 </template>
 <script lang="ts">
-import { reactive, toRefs, computed, ref, Ref, watch } from 'vue';
+import { reactive, toRefs, computed, ref, Ref, watch, ComputedRef } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import NutScrollView from '../scrollView/index.taro.vue';
 import Taro from '@tarojs/taro';
@@ -79,7 +79,7 @@ export default create({
       return state.list.length * props.height;
     });
 
-    const visibleData = computed(() => {
+    const visibleData: ComputedRef = computed(() => {
       return state.list.slice(state.start, Math.min(end.value, state.list.length));
     });
 

+ 2 - 2
src/packages/__VUE/list/index.vue

@@ -9,7 +9,7 @@
   </div>
 </template>
 <script lang="ts">
-import { reactive, toRefs, computed, ref, Ref, watch } from 'vue';
+import { reactive, toRefs, computed, ref, Ref, watch, ComputedRef } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 const { componentName, create } = createComponent('list');
 const clientHeight = document.documentElement.clientHeight || document.body.clientHeight || 667;
@@ -67,7 +67,7 @@ export default create({
       return state.list.length * props.height;
     });
 
-    const visibleData = computed(() => {
+    const visibleData: ComputedRef = computed(() => {
       return state.list.slice(state.start, Math.min(end.value, state.list.length));
     });
 

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

@@ -5,7 +5,7 @@
 </template>
 
 <script lang="ts">
-import { computed, reactive, inject, getCurrentInstance, onUnmounted } from 'vue';
+import { computed, reactive, inject, getCurrentInstance, onUnmounted, ComputedRef } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import { useExpose } from '@/packages/utils/useExpose/index';
 import { IStyle } from './type';
@@ -26,7 +26,7 @@ export default create({
       };
     });
 
-    const style = computed(() => {
+    const style: ComputedRef = computed(() => {
       const style: IStyle = {};
       const direction = parent?.props.direction;
       if (parent?.size.value) {

+ 2 - 2
src/packages/__VUE/swiperitem/index.vue

@@ -5,7 +5,7 @@
 </template>
 
 <script lang="ts">
-import { computed, reactive, inject, getCurrentInstance, onUnmounted } from 'vue';
+import { computed, reactive, inject, getCurrentInstance, onUnmounted, ComputedRef } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import { useExpose } from '@/packages/utils/useExpose/index';
 import { IStyle } from './type';
@@ -26,7 +26,7 @@ export default create({
       };
     });
 
-    const style = computed(() => {
+    const style: ComputedRef = computed(() => {
       const style: IStyle = {};
       const direction = parent?.props.direction;
       if (parent?.size.value) {