浏览代码

fix: calender 适配

guoxiaoxiao8 4 年之前
父节点
当前提交
5bf16fc8a1

+ 1 - 1
src/packages/__VUE/calendaritem/index.scss

@@ -2,7 +2,7 @@
   position: relative;
   display: flex;
   flex: 1;
-  height: 518px;
+  height: 65vh;
   padding-top: 132px;
   padding-bottom: 78px;
   color: $calendar-base-color;

+ 2 - 1
src/sites/mobile-taro/vue/src/app.config.ts

@@ -1,7 +1,8 @@
 export default {
   pages: [
-    'pages/picker/demo',
     'pages/calendar/demo',
+    'pages/picker/demo',
+
     'pages/input/demo',
     'pages/popup/demo',
     'pages/inputnumber/demo',

+ 7 - 5
src/sites/mobile-taro/vue/src/pages/calendar/demo.vue

@@ -78,7 +78,7 @@
 import { reactive, toRefs } from 'vue';
 import { createComponent } from './../../../../../../packages/utils/create';
 import Calendar from './index.taro.vue';
-
+import Cell from '../cell/index.taro.vue';
 const { createDemo } = createComponent('calendar');
 
 interface TestCalendarState {
@@ -94,7 +94,8 @@ interface TestCalendarState {
 export default createDemo({
   props: {},
   components: {
-    'nut-calendar': Calendar
+    'nut-calendar': Calendar,
+    'nut-cell': Cell
   },
   setup() {
     const state: TestCalendarState = reactive({
@@ -111,12 +112,13 @@ export default createDemo({
       date3: ''
     });
     const openSwitch = (param: string) => {
-      // state[`${param}`] = true;
-      state.isVisible1 = true;
+      state[`${param}`] = true;
+      //state.isVisible = true;
     };
 
     const closeSwitch = (param: string) => {
-      //state[`${param}`] = false;
+      state[`${param}`] = false;
+      //state.isVisible = false;
     };
 
     const setChooseValue = (param: string) => {

+ 7 - 2
src/sites/mobile-taro/vue/src/pages/calendar/index.taro.vue

@@ -1,7 +1,7 @@
 <template>
   <nut-popup
     v-if="poppable"
-    :visible="visible"
+    v-model:visible="visible"
     position="bottom"
     round
     :closeable="true"
@@ -24,6 +24,7 @@
     >
     </nut-calendar-item>
   </nut-popup>
+
   <nut-calendar-item
     v-else
     :type="type"
@@ -49,6 +50,10 @@ import Utils from './../../../../../../packages/utils/date';
 type InputDate = string | string[];
 export default create({
   children: [CalendarItem, Popup],
+  components: {
+    'nut-calendar-item': CalendarItem,
+    'nut-popup': Popup
+  },
   props: {
     type: {
       type: String,
@@ -64,7 +69,7 @@ export default create({
     },
     visible: {
       type: Boolean,
-      default: false
+      default: true
     },
     title: {
       type: String,