Skip to content

Commit 7f20397

Browse files
lkjh3214lkjh3214szg2008
authored
doc: calendar 文档修改 (#1410)
* feat: 添加range组件、calendar组件在线文档 * fix: 文档调整 * fix: 重构calendar组件 * feat: 日历组件重构,文档修改,功能完善 * fix: 格式化 * fix: 代码格式化调整。 * fix: 去除无用代码 * fix: 文档调整 * fix: 文档调整 * fix: taro demo 样式修改 * feat: range组件功能完善,新增 竖向操作,刻度展示。 * fix: 冲突解决 * feat: taro功能新增,兼容处理,文档修改 * feat: 添加range组件,jdt主题色 * fix: 修改组件初始化逻辑 * feat: 新增h5 日期多选功能 * feat: taro版本添加 日期多选功能 * fix: 修复多选,无法选中开头结尾日期问题 * fix: 文档修改,添加en-US 文档 * fix: 文档完善 Co-authored-by: lkjh3214 <[email protected]> Co-authored-by: love_forever <[email protected]>
1 parent 6e2bd46 commit 7f20397

File tree

10 files changed

+64
-63
lines changed

10 files changed

+64
-63
lines changed

src/packages/__VUE/animate/index.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}
55

66
/* Animation css */
7-
[class*="nut-animate-"] {
7+
[class*='nut-animate-'] {
88
animation-duration: 0.5s;
99
animation-timing-function: ease-out;
1010
animation-fill-mode: both;
@@ -235,7 +235,7 @@
235235
&::before {
236236
width: 60 * 1px;
237237
height: 60 * 1px;
238-
content: "";
238+
content: '';
239239
box-sizing: border-box;
240240
border: 4 * 1px solid rgba(255, 255, 255, 0.6);
241241
position: absolute;
@@ -279,7 +279,7 @@
279279
left: 0;
280280
top: 0;
281281
opacity: 0.73;
282-
content: "";
282+
content: '';
283283
background-image: linear-gradient(106deg, rgba(232, 224, 255, 0) 24%, #e8e0ff 91%);
284284
animation: flicker 1.5s linear infinite;
285285
transform: skewX(-20deg);
@@ -296,4 +296,4 @@
296296
transform: translateX(150 * 1px) skewX(-20deg);
297297
}
298298
}
299-
}
299+
}

src/packages/__VUE/animate/index.taro.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<view class="nut-animate">
3-
<view :class='classes' @click='handleClick'>
3+
<view :class="classes" @click="handleClick">
44
<slot></slot>
55
</view>
66
</view>
@@ -38,19 +38,18 @@ export default create({
3838
return {
3939
'nut-ani-container': true,
4040
[`${prefixCls}-${type.value}`]: action.value === 'initial' || state.clicked ? type.value : false,
41-
'loop': loop.value,
41+
loop: loop.value
4242
};
4343
});
4444
4545
const handleClick = (event: Event) => {
46-
47-
state.clicked = true
46+
state.clicked = true;
4847
4948
//如果不是无限循环,清除类名
5049
if (!loop.value) {
5150
setTimeout(() => {
52-
state.clicked = false
53-
}, 1000)
51+
state.clicked = false;
52+
}, 1000);
5453
}
5554
5655
emit('click', event);

src/packages/__VUE/animate/index.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<view class="nut-animate">
3-
<view :class='classes' @click='handleClick'>
3+
<view :class="classes" @click="handleClick">
44
<slot></slot>
55
</view>
66
</view>
@@ -38,19 +38,18 @@ export default create({
3838
return {
3939
'nut-ani-container': true,
4040
[`${prefixCls}-${type.value}`]: action.value === 'initial' || state.clicked ? type.value : false,
41-
'loop': loop.value,
41+
loop: loop.value
4242
};
4343
});
4444
4545
const handleClick = (event: Event) => {
46-
47-
state.clicked = true
46+
state.clicked = true;
4847
4948
//如果不是无限循环,清除类名
5049
if (!loop.value) {
5150
setTimeout(() => {
52-
state.clicked = false
53-
}, 1000)
51+
state.clicked = false;
52+
}, 1000);
5453
}
5554
5655
emit('click', event);

src/packages/__VUE/animate/type.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
export type AnimateType = 'shake' | 'ripple' | 'breath' | 'float' | 'slide-right' | 'slide-left' | 'slide-top' | 'slide-bottom' | 'jump' | 'twinkle' | 'flicker';
1+
export type AnimateType =
2+
| 'shake'
3+
| 'ripple'
4+
| 'breath'
5+
| 'float'
6+
| 'slide-right'
7+
| 'slide-left'
8+
| 'slide-top'
9+
| 'slide-bottom'
10+
| 'jump'
11+
| 'twinkle'
12+
| 'flicker';
213
export type AnimateAction = 'initial' | 'click';

src/packages/__VUE/calendar/doc.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ export default {
559559
| confirm-text | Bottom confirm button text | String | ’Confirm‘ |
560560
| show-title | Whether to show the calendar title | Boolean | true |
561561
| show-sub-title | Whether to display the date title | Boolean | true |
562+
| to-date-animation | Whether to use scroll animation | Boolean | true |
562563

563564
### Events
564565

src/packages/__VUE/calendar/doc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ export default {
552552
| confirm-text | 底部确认按钮文案 | String | ’确认‘ |
553553
| show-title | 是否在展示日历标题 | Boolean | true |
554554
| show-sub-title | 是否展示日期标题 | Boolean | true |
555+
| to-date-animation | 是否启动滚动动画 | Boolean | true |
555556

556557
### Events
557558

src/packages/__VUE/calendar/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ export default create({
168168
// element refs
169169
const calendarRef = ref<null | HTMLElement>(null);
170170
const scrollToDate = (date: string) => {
171-
console.log(calendarRef.value);
172171
calendarRef.value?.scrollToDate(date);
173172
};
174173
useExpose({

src/packages/__VUE/calendaritem/index.taro.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -622,12 +622,9 @@ export default create({
622622
} else if (!Utils.compareDate(date, state.propEndDate)) {
623623
date = state.propEndDate;
624624
}
625-
console.log(date);
626625
let dateArr = splitDate(date);
627626
state.monthsData.forEach((item, index) => {
628627
if (item.title == translate('monthTitle', dateArr[0], dateArr[1])) {
629-
// if (months.value) {
630-
631628
if (props.toDateAnimation) {
632629
Taro.createSelectorQuery()
633630
.select('.nut-calendar-content')
@@ -639,8 +636,6 @@ export default create({
639636
flag++;
640637
if (months.value) {
641638
let offset = distance / 10;
642-
console.log('scrolltodate ', distance, offset);
643-
644639
state.scrollTop = state.scrollTop + offset;
645640
}
646641
if (flag >= 10) {
@@ -655,7 +650,6 @@ export default create({
655650
} else {
656651
state.scrollTop = state.monthsData[index].cssScrollHeight;
657652
}
658-
// }
659653
}
660654
});
661655
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export default { navigationBarTitleText: 'Animate' }
1+
export default { navigationBarTitleText: 'Animate' };

src/sites/mobile-taro/vue/src/exhibition/pages/animate/index.vue

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,74 @@
11
<template>
2-
<div class='demo'>
3-
2+
<div class="demo">
43
<h2>点击触发</h2>
54

6-
<div class='ani-demo-div'>
7-
<nut-animate type='slide-right' action='click'>
8-
<nut-button type='primary'>由右向左划入</nut-button>
5+
<div class="ani-demo-div">
6+
<nut-animate type="slide-right" action="click">
7+
<nut-button type="primary">由右向左划入</nut-button>
98
</nut-animate>
109
</div>
1110

12-
<div class='ani-demo-div'>
13-
<nut-animate type='slide-left' action='click'>
14-
<nut-button type='primary'>由左向右划入</nut-button>
11+
<div class="ani-demo-div">
12+
<nut-animate type="slide-left" action="click">
13+
<nut-button type="primary">由左向右划入</nut-button>
1514
</nut-animate>
1615
</div>
1716

18-
<div class='ani-demo-div'>
19-
<nut-animate type='slide-top' action='click'>
20-
<nut-button type='primary'>由上至下划入</nut-button>
17+
<div class="ani-demo-div">
18+
<nut-animate type="slide-top" action="click">
19+
<nut-button type="primary">由上至下划入</nut-button>
2120
</nut-animate>
2221
</div>
2322

24-
<div class='ani-demo-div'>
25-
<nut-animate type='slide-bottom' action='click'>
26-
<nut-button type='primary'>由下至上划入</nut-button>
23+
<div class="ani-demo-div">
24+
<nut-animate type="slide-bottom" action="click">
25+
<nut-button type="primary">由下至上划入</nut-button>
2726
</nut-animate>
2827
</div>
2928

3029
<h2>循环动画</h2>
3130

32-
<div class='ani-demo-div'>
33-
<nut-animate type='shake' :loop='true'>
34-
<nut-button type='primary'>shake-抖动</nut-button>
31+
<div class="ani-demo-div">
32+
<nut-animate type="shake" :loop="true">
33+
<nut-button type="primary">shake-抖动</nut-button>
3534
</nut-animate>
3635
</div>
3736

38-
<div class='ani-demo-div'>
39-
<nut-animate type='ripple' :loop='true'>
40-
<nut-button type='primary'>ripple-心跳</nut-button>
37+
<div class="ani-demo-div">
38+
<nut-animate type="ripple" :loop="true">
39+
<nut-button type="primary">ripple-心跳</nut-button>
4140
</nut-animate>
4241
</div>
4342

44-
<div class='ani-demo-div'>
45-
<nut-animate type='breath' :loop='true'>
46-
<nut-button type='primary'>breath-呼吸灯</nut-button>
43+
<div class="ani-demo-div">
44+
<nut-animate type="breath" :loop="true">
45+
<nut-button type="primary">breath-呼吸灯</nut-button>
4746
</nut-animate>
4847
</div>
4948

50-
<div class='ani-demo-div'>
51-
<nut-animate type='twinkle' :loop='true'>
52-
<nut-button type='primary'>twinkle-水波</nut-button>
49+
<div class="ani-demo-div">
50+
<nut-animate type="twinkle" :loop="true">
51+
<nut-button type="primary">twinkle-水波</nut-button>
5352
</nut-animate>
5453
</div>
5554

56-
<div class='ani-demo-div'>
57-
<nut-animate type='flicker' :loop='true'>
58-
<nut-button type='primary'>flicker-擦亮</nut-button>
55+
<div class="ani-demo-div">
56+
<nut-animate type="flicker" :loop="true">
57+
<nut-button type="primary">flicker-擦亮</nut-button>
5958
</nut-animate>
6059
</div>
6160

62-
<div class='ani-demo-div'>
63-
<nut-animate type='jump' :loop='true'>
64-
<nut-button type='primary'>jump-跳跃</nut-button>
61+
<div class="ani-demo-div">
62+
<nut-animate type="jump" :loop="true">
63+
<nut-button type="primary">jump-跳跃</nut-button>
6564
</nut-animate>
6665
</div>
6766

68-
<div class='ani-demo-div'>
69-
<nut-animate type='float' :loop='true'>
70-
<nut-button type='primary'>float-漂浮</nut-button>
67+
<div class="ani-demo-div">
68+
<nut-animate type="float" :loop="true">
69+
<nut-button type="primary">float-漂浮</nut-button>
7170
</nut-animate>
7271
</div>
73-
74-
7572
</div>
7673
</template>
7774
<script lang="ts">
@@ -83,7 +80,7 @@ export default defineComponent({
8380
}
8481
});
8582
</script>
86-
<style lang='scss' scoped>
83+
<style lang="scss" scoped>
8784
.demo {
8885
}
8986

0 commit comments

Comments
 (0)