浏览代码

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

Drjnigfubo 3 年之前
父节点
当前提交
6dc2282191

+ 1 - 1
src/packages/__VUE/list/__tests__/list.spec.ts

@@ -14,7 +14,7 @@ test('should render height', async () => {
   await nextTick();
 
   const listItem = wrapper.findAll('.nut-list-item')[0];
-  expect((listItem.element as any).style.height).toEqual('50px');
+  expect((listItem.element as HTMLDivElement).style.height).toEqual('50px');
 });
 
 test('should render height', async () => {

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

@@ -20,7 +20,7 @@ import { reactive, toRefs, computed, ref, Ref, watch } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import Taro from '@tarojs/taro';
 const { componentName, create } = createComponent('list');
-const clientHeight = Taro.getSystemInfoSync().windowHeight;
+const clientHeight = Taro.getSystemInfoSync().windowHeight || 667;
 export default create({
   props: {
     height: {
@@ -35,7 +35,7 @@ export default create({
     },
     containerHeight: {
       type: [Number],
-      default: clientHeight || 667
+      default: clientHeight
     }
   },
   emits: ['scroll', 'scroll-bottom'],

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

@@ -12,7 +12,7 @@
 import { reactive, toRefs, computed, ref, Ref, watch } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 const { componentName, create } = createComponent('list');
-const clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
+const clientHeight = document.documentElement.clientHeight || document.body.clientHeight || 667;
 export default create({
   props: {
     height: {
@@ -27,7 +27,7 @@ export default create({
     },
     containerHeight: {
       type: [Number],
-      default: clientHeight || 667
+      default: clientHeight
     }
   },
   emits: ['scroll', 'scroll-bottom'],