浏览代码

fix: infiniteloading 单元测试 (#1236)

* feat: 冲突解决 (#2)

* fix(uploader): taro h5 env upload error #1096

* fix: taro 3.4.6 sass calc error #1200

* fix(uploader): taro env formdata type error

* chore: add international components signature

* chore: add international components ecard

* chore: add international components timeselect

* chore: add international components sku

* fix: demo textarea 自适应 (#1201)

* feat: add translations chinese traditional

* docs: open international

* fix: input show-word-limit default false (#1203)

* refactor(circleprogress): add features (#1204)

* fix(popup): 修复popup在Taro转H5下的渲染问题

* feat: avatar能力补齐、input doc文档更新 (#1195)

* fix: 修改input单元测试

* fix: 增加avatar group

* fix: 更新input md

* fix: avatar能力补齐

* fix: avatar能力补齐、适配taro

* feat: 迁移 AddressList、Category 组件,适配taro

* fix: 修改input md

Co-authored-by: richard1015 <51844712@qq.com>

* chore: add international components addresslist

Co-authored-by: richard1015 <51844712@qq.com>
Co-authored-by: Ymm <being0008@163.com>
Co-authored-by: Lei Wang <wlchn@qq.com>
Co-authored-by: Drjingfubo <50685476+Drjingfubo@users.noreply.github.com>
Co-authored-by: suzigang <1039168735@qq.com>
Co-authored-by: ailululu <912429321@qq.com>

* feat: picker与DatePicker新增slot插槽

* fix: datepicker 问题修改

* fix: infiniteloading issue 问题修改(#1189)

* fix: countdown 问题修改

* feat: 冲突解决

* feat: 初版

* feat: countdown 单元测试

* feat: 文档补齐

* fix: datepicker 初始化时平铺展示 bug 修改

* feat: git action 增加 doc.en-US 文件复制

* fix: 单元测试

Co-authored-by: richard1015 <51844712@qq.com>
Co-authored-by: Ymm <being0008@163.com>
Co-authored-by: Lei Wang <wlchn@qq.com>
Co-authored-by: Drjingfubo <50685476+Drjingfubo@users.noreply.github.com>
Co-authored-by: suzigang <1039168735@qq.com>
Co-authored-by: ailululu <912429321@qq.com>
yangxiaolu1993 3 年之前
父节点
当前提交
eeda02d04f

+ 10 - 3
src/packages/__VUE/datepicker/__tests__/datepicker.spec.ts

@@ -2,6 +2,9 @@ import { config, mount } from '@vue/test-utils';
 import { nextTick, ref, toRefs, reactive, onMounted } from 'vue';
 import NutIcon from '../../icon/index.vue';
 import NutRange from '../../range/index.vue';
+import NutPicker from '../../picker/index.vue';
+import NutPopup from '../../popup/index.vue';
+import NutPickerColumn from '../../picker/Column.vue';
 import DatePicker from '../../datepicker/index.vue';
 
 function sleep(delay = 0): Promise<void> {
@@ -13,7 +16,10 @@ function sleep(delay = 0): Promise<void> {
 beforeAll(() => {
   config.global.components = {
     NutIcon,
-    NutRange
+    NutRange,
+    NutPicker,
+    NutPopup,
+    NutPickerColumn
   };
 });
 
@@ -25,6 +31,7 @@ test('Do not display Chinese', async () => {
   const wrapper = mount(DatePicker, {
     props: {
       modelValue: new Date(2020, 0, 1),
+      type: 'year-month',
       visible: true,
       isWrapTeleport: false,
       isShowChinese: false
@@ -36,10 +43,9 @@ test('Do not display Chinese', async () => {
   confirm.trigger('click');
   expect(wrapper.emitted().confirm[0]).toEqual([
     {
-      selectedValue: ['2020', '01', '01'],
+      selectedValue: ['2020', '01'],
       selectedOptions: [
         { text: '2020', value: '2020' },
-        { text: '01', value: '01' },
         { text: '01', value: '01' }
       ]
     }
@@ -49,6 +55,7 @@ test('Do not display Chinese', async () => {
 test('min date & max date', async () => {
   const wrapper = mount(DatePicker, {
     props: {
+      type: 'year-month',
       minDate: new Date(2020, 0, 1),
       maxDate: new Date(2022, 10, 1),
       visible: true,

+ 11 - 2
src/packages/__VUE/datepicker/index.vue

@@ -17,7 +17,7 @@
 <script lang="ts">
 import { toRefs, watch, computed, reactive, onBeforeMount } from 'vue';
 import type { PropType } from 'vue';
-import picker from '../picker/index.vue';
+import Picker from '../picker/index.vue';
 import { popupProps } from '../popup/index.vue';
 import { PickerOption } from '../picker/types';
 import { createComponent } from '@/packages/utils/create';
@@ -44,7 +44,7 @@ const zhCNType: {
 };
 export default create({
   components: {
-    [picker.name]: picker
+    [Picker.name]: Picker
   },
   props: {
     ...popupProps,
@@ -137,6 +137,15 @@ export default create({
             }
           }
         }
+      } else {
+        return {
+          [`${type}Year`]: year,
+          [`${type}Month`]: month,
+          [`${type}Day`]: day,
+          [`${type}Hour`]: hour,
+          [`${type}Minute`]: minute,
+          [`${type}Seconds`]: seconds
+        };
       }
 
       return {

+ 4 - 4
src/packages/__VUE/infiniteloading/index.vue

@@ -225,10 +225,10 @@ export default create({
       }
     };
 
-    // // 滚动监听对象
-    // const getParentElement = (el: HTMLElement) => {
-    //   return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;
-    // };
+    // 滚动监听对象
+    const getParentElement = (el: HTMLElement) => {
+      return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;
+    };
 
     onMounted(() => {
       const parentElement = getParentElement(state.scroller as HTMLElement) as Node & ParentNode;