提交 5bf16fc8 编写于 作者: G guoxiaoxiao8

fix: calender 适配

上级 42824b93
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
position: relative; position: relative;
display: flex; display: flex;
flex: 1; flex: 1;
height: 518px; height: 65vh;
padding-top: 132px; padding-top: 132px;
padding-bottom: 78px; padding-bottom: 78px;
color: $calendar-base-color; color: $calendar-base-color;
......
export default { export default {
pages: [ pages: [
'pages/picker/demo',
'pages/calendar/demo', 'pages/calendar/demo',
'pages/picker/demo',
'pages/input/demo', 'pages/input/demo',
'pages/popup/demo', 'pages/popup/demo',
'pages/inputnumber/demo', 'pages/inputnumber/demo',
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
import { reactive, toRefs } from 'vue'; import { reactive, toRefs } from 'vue';
import { createComponent } from './../../../../../../packages/utils/create'; import { createComponent } from './../../../../../../packages/utils/create';
import Calendar from './index.taro.vue'; import Calendar from './index.taro.vue';
import Cell from '../cell/index.taro.vue';
const { createDemo } = createComponent('calendar'); const { createDemo } = createComponent('calendar');
interface TestCalendarState { interface TestCalendarState {
...@@ -94,7 +94,8 @@ interface TestCalendarState { ...@@ -94,7 +94,8 @@ interface TestCalendarState {
export default createDemo({ export default createDemo({
props: {}, props: {},
components: { components: {
'nut-calendar': Calendar 'nut-calendar': Calendar,
'nut-cell': Cell
}, },
setup() { setup() {
const state: TestCalendarState = reactive({ const state: TestCalendarState = reactive({
...@@ -111,12 +112,13 @@ export default createDemo({ ...@@ -111,12 +112,13 @@ export default createDemo({
date3: '' date3: ''
}); });
const openSwitch = (param: string) => { const openSwitch = (param: string) => {
// state[`${param}`] = true; state[`${param}`] = true;
state.isVisible1 = true; //state.isVisible = true;
}; };
const closeSwitch = (param: string) => { const closeSwitch = (param: string) => {
//state[`${param}`] = false; state[`${param}`] = false;
//state.isVisible = false;
}; };
const setChooseValue = (param: string) => { const setChooseValue = (param: string) => {
......
<template> <template>
<nut-popup <nut-popup
v-if="poppable" v-if="poppable"
:visible="visible" v-model:visible="visible"
position="bottom" position="bottom"
round round
:closeable="true" :closeable="true"
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
> >
</nut-calendar-item> </nut-calendar-item>
</nut-popup> </nut-popup>
<nut-calendar-item <nut-calendar-item
v-else v-else
:type="type" :type="type"
...@@ -49,6 +50,10 @@ import Utils from './../../../../../../packages/utils/date'; ...@@ -49,6 +50,10 @@ import Utils from './../../../../../../packages/utils/date';
type InputDate = string | string[]; type InputDate = string | string[];
export default create({ export default create({
children: [CalendarItem, Popup], children: [CalendarItem, Popup],
components: {
'nut-calendar-item': CalendarItem,
'nut-popup': Popup
},
props: { props: {
type: { type: {
type: String, type: String,
...@@ -64,7 +69,7 @@ export default create({ ...@@ -64,7 +69,7 @@ export default create({
}, },
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: true
}, },
title: { title: {
type: String, type: String,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册