Browse Source

fix: datePicker 组件平铺展示不展示问题修改 (#1229)

* 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 修改

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 years ago
parent
commit
77be7caeb0

+ 8 - 2
src/packages/__VUE/datepicker/doc.md

@@ -9,12 +9,14 @@
 ```javascript
 import { createApp } from 'vue';
 // vue
-import { DatePicker, Picker } from '@nutui/nutui';
+import { DatePicker, Picker, Popup } from '@nutui/nutui';
 // taro
-import { DatePicker, Picker } from '@nutui/nutui-taro';
+import { DatePicker, Picker, Popup } from '@nutui/nutui-taro';
 
 const app = createApp();
 app.use(DatePicker);
+app.use(Picker);
+app.use(Popup);
 ```
     
 ## 代码演示
@@ -40,6 +42,8 @@ app.use(DatePicker);
     setup(props) {
       const show = ref(false);
       const desc = ref('2022年05月10日');
+      const minDate = new Date(2020, 0, 1),
+      const maxDate = new Date(2025, 10, 1),
       const currentDate = new Date(2022, 4, 10, 10, 10);
       const confirm = ({ selectedValue, selectedOptions })=>{
         desc.value = selectedOptions.map((option) => option.text).join('');
@@ -48,6 +52,8 @@ app.use(DatePicker);
         currentDate,
         show,
         desc,
+        minDate,
+        maxDate,
         confirm
       };
     }

+ 2 - 1
src/packages/__VUE/datepicker/index.taro.vue

@@ -92,7 +92,7 @@ export default create({
 
   setup(props, { emit }) {
     const state = reactive({
-      show: false,
+      show: props.visible,
       currentDate: new Date(),
       title: props.title,
       selectedValue: []
@@ -307,6 +307,7 @@ export default create({
     };
 
     onBeforeMount(() => {
+      console.log('平铺展示');
       state.currentDate = formatValue(props.modelValue);
     });
 

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

@@ -1,7 +1,7 @@
 <template>
   <nut-picker
     v-model="selectedValue"
-    :visible="show"
+    v-model:visible="show"
     :okText="okText"
     :cancelText="cancelText"
     @close="closeHandler"
@@ -93,7 +93,7 @@ export default create({
 
   setup(props, { emit }) {
     const state = reactive({
-      show: false,
+      show: props.visible,
       currentDate: new Date(),
       title: props.title,
       selectedValue: []
@@ -202,7 +202,6 @@ export default create({
           break;
       }
 
-      console.log('result', result);
       return result;
     });
 
@@ -223,7 +222,6 @@ export default create({
       selectedValue: (string | number)[];
       selectedOptions: PickerOption[];
     }) => {
-      console.log('滚动', selectedValue);
       if (['date', 'datetime', 'datehour', 'month-day'].includes(props.type)) {
         let formatDate: (number | string)[] = [];
         selectedValue.forEach((item) => {
@@ -237,7 +235,6 @@ export default create({
         const month = Number(formatDate[1]) - 1;
         const day = Math.min(Number(formatDate[2]), getMonthEndDay(Number(formatDate[0]), Number(formatDate[1])));
         let date: Date | null = null;
-        console.log(year, month, day);
         if (props.type === 'date' || props.type === 'month-day') {
           date = new Date(year, month, day);
         } else if (props.type === 'datetime') {
@@ -246,8 +243,6 @@ export default create({
           date = new Date(year, month, day, Number(formatDate[3]));
         }
         state.currentDate = formatValue(date as Date);
-
-        console.log(state.currentDate);
       }
 
       emit('change', { columnIndex, selectedValue, selectedOptions });