Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(calendar): 新增初始化位置方法 #2083

Merged
merged 66 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
c805a21
feat: 添加range组件、calendar组件在线文档
Jan 20, 2022
55c6e33
fix: 文档调整
Jan 21, 2022
bad287f
fix: 重构calendar组件
Feb 18, 2022
bffc56e
Merge branch 'upstream_next' into next
Feb 18, 2022
24a9967
Merge branch 'next' into lk-nutui
Feb 18, 2022
86140ef
feat: 日历组件重构,文档修改,功能完善
Feb 23, 2022
455d613
Merge branch 'lk-nutui' of ssh://github.com/lkjh3214/nutui into lk-nutui
Feb 23, 2022
097935f
fix: 格式化
Feb 23, 2022
cc8eac2
Merge branch 'next' of ssh://github.com/lkjh3214/nutui into next
Feb 23, 2022
5c26c3f
fix: 代码格式化调整。
Feb 23, 2022
64a74bd
fix: 去除无用代码
Feb 23, 2022
261674e
Merge branch 'lk-nutui' into next
Feb 23, 2022
34e7f5a
fix: 文档调整
Feb 23, 2022
83c3252
fix: 文档调整
Feb 23, 2022
246c7ef
fix: taro demo 样式修改
Feb 23, 2022
13a64e3
Merge branch 'upstream_next' into lk-nutui
Feb 23, 2022
6ca304c
Merge branch 'upstream_next' into lk-nutui
Mar 22, 2022
06bfbd7
Merge branch 'upstream_next' into lk-nutui
Mar 22, 2022
8af99db
feat: range组件功能完善,新增 竖向操作,刻度展示。
Mar 22, 2022
32920b1
Merge branch 'upstream_next' into lk-nutui
Mar 22, 2022
d5cb5d0
fix: 冲突解决
Mar 22, 2022
d096a28
feat: taro功能新增,兼容处理,文档修改
Mar 22, 2022
fc48524
Merge branch 'upstream_next' into lk-nutui
Mar 22, 2022
967affa
Merge branch 'next' into lk-nutui
szg2008 Mar 25, 2022
b20666e
Merge branch 'upstream_next' into lk-nutui
Mar 25, 2022
7721d7b
feat: 添加range组件,jdt主题色
Mar 25, 2022
170a777
Merge branch 'upstream_next' into lk-nutui
Mar 30, 2022
6aa79b4
Merge branch 'upstream_next' into lk-nutui
Apr 6, 2022
3a18252
Merge branch 'upstream_next' into lk-nutui
Apr 21, 2022
cc0ec20
fix: 修改组件初始化逻辑
Apr 24, 2022
e41e7df
Merge branch 'upstream_next' into lk-nutui
Apr 24, 2022
5fa9702
feat: 新增h5 日期多选功能
May 9, 2022
8fcd6ff
Merge branch 'lk-nutui' into lk-dev-calendar
May 20, 2022
fa6f570
feat: taro版本添加 日期多选功能
May 20, 2022
58e8f79
fix: 修复多选,无法选中开头结尾日期问题
Jun 21, 2022
7e99775
Merge branch 'upstream_next' into lk-dev-calendar
Jun 21, 2022
5089372
fix: 文档修改,添加en-US 文档
Jun 21, 2022
3078dca
Merge branch 'upstream_next' into lk-dev-calendar
Jun 21, 2022
b8c28eb
fix: 文档完善
Jun 23, 2022
b27a36d
Merge branch 'upstream_next' into lk-dev-calendar
Jun 23, 2022
5988e41
Merge branch 'upstream_next' into lk-dev-calendar
Sep 7, 2022
95f7f83
fix: calendar,demo错误修复
Sep 7, 2022
693fc13
fix: swiper文档修改
Sep 8, 2022
5f88508
Merge branch 'upstream_next' into lk-dev-calendar
Sep 29, 2022
6fbad82
fix: 日历组件问题修复
Sep 29, 2022
9d9305c
Merge branch 'upstream_next' into lk-dev-calendar
Sep 29, 2022
e17b9e5
Merge branch 'upstream_next' into lk-dev-calendar
Sep 30, 2022
557e93e
Merge branch 'upstream_next' into lk-dev-calendar
Oct 10, 2022
1c36f93
fix: calendar taro兼容问题调整
Oct 12, 2022
8fc03b7
Merge branch 'upstream_next' into lk-dev-calendar
Oct 12, 2022
03474a4
fix: taro转h5问题修改
Oct 17, 2022
00110fe
Merge branch 'upstream_next' into lk-dev-calendar
Oct 17, 2022
d6fb21d
fix: 日历组件修改,vite配置修改,新增plugin
Oct 19, 2022
fd22642
Merge branch 'upstream_next' into lk-dev-calendar
Oct 19, 2022
a6bc9a3
fix: 配置项修改
Oct 21, 2022
112c514
Merge branch 'upstream_next' into lk-dev-calendar
Oct 26, 2022
16c04b4
Merge branch 'upstream_next' into lk-dev-calendar
Oct 26, 2022
ebcac7c
fix: 指定taro版本
Nov 3, 2022
42b19ba
fix: taro版本指定为3.5.6
Nov 3, 2022
9546953
fix: 修复scroll-view标签问题
Nov 3, 2022
e92613f
Merge branch 'upstream_next' into lk-dev-calendar
Nov 3, 2022
943c85b
feat: 日历组件,暴露初始化定位方法
Nov 11, 2022
31b900f
Merge branch 'upstream_next' into lk-dev-calendar
Nov 11, 2022
8683bd5
fix: 修改文档,调整全局样式
Dec 12, 2022
784231c
Merge branch 'upstream_next' into lk-dev-calendar
Jan 31, 2023
5991a5d
fix: calendar 文档修改
Jan 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/packages/__VUE/calendar/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,3 +643,4 @@ Through [ref](https://vuejs.org/guide/essentials/template-refs.html), you can ge
| Name | Description | Arguments |
|--------|------------------|---------------|
| scrollToDate | Scroll to the month of the specified date | string:'2021-12-30' |
| initPosition`v3.3.4` | Initialize scroll position | |
1 change: 1 addition & 0 deletions src/packages/__VUE/calendar/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -636,3 +636,4 @@ export default {
| 方法名 | 说明 | 参数 |
|--------|------------------|---------------|
| scrollToDate | 滚动到指定日期所在月 | string:'2021-12-30' |
| initPosition`v3.3.4` | 初始化滚动位置 | 无 |
6 changes: 5 additions & 1 deletion src/packages/__VUE/calendar/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ export default create({
const scrollToDate = (date: string) => {
calendarRef.value?.scrollToDate(date);
};
const initPosition = () => {
calendarRef.value?.initPosition();
};
useExpose({
scrollToDate
scrollToDate,
initPosition
});
// methods
const update = () => {
Expand Down
6 changes: 5 additions & 1 deletion src/packages/__VUE/calendar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,12 @@ export default create({
const scrollToDate = (date: string) => {
calendarRef.value?.scrollToDate(date);
};
const initPosition = () => {
calendarRef.value?.initPosition();
};
useExpose({
scrollToDate
scrollToDate,
initPosition
});
// methods
const update = () => {
Expand Down
9 changes: 6 additions & 3 deletions src/packages/__VUE/calendaritem/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,8 @@ export default create({
let containerHeight = lastItem.cssHeight + lastItem.cssScrollHeight;

state.containerHeight = `${containerHeight}px`;
state.scrollTop = Math.ceil(state.monthsData[state.currentIndex].cssScrollHeight);
initPosition();
state.avgHeight = Math.floor(containerHeight / (monthsNum + 1));

if (months?.value) {
viewHeight.value = months.value.clientHeight;
}
Expand Down Expand Up @@ -691,8 +690,12 @@ export default create({
}
});
};
const initPosition = () => {
state.scrollTop = Math.ceil(state.monthsData[state.currentIndex].cssScrollHeight);
};
useExpose({
scrollToDate
scrollToDate,
initPosition
});
const setDefaultRange = (monthsNum: number, current: number) => {
let rangeArr: any[] = [];
Expand Down
10 changes: 8 additions & 2 deletions src/packages/__VUE/calendaritem/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ export default create({
if (months?.value && monthsPanel?.value && viewArea?.value) {
viewHeight.value = months.value.clientHeight;
monthsPanel.value.style.height = `${containerHeight}px`;
months.value.scrollTop = state.monthsData[state.currentIndex].cssScrollHeight;
initPosition();
}
});
state.avgHeight = Math.floor(containerHeight / (monthsNum + 1));
Expand Down Expand Up @@ -671,8 +671,14 @@ export default create({
}
});
};
const initPosition = () => {
if (months?.value) {
months.value.scrollTop = state.monthsData[state.currentIndex].cssScrollHeight;
}
};
useExpose({
scrollToDate
scrollToDate,
initPosition
});
// 设置当前可见月份
const setDefaultRange = (monthsNum: number, current: number) => {
Expand Down
2 changes: 1 addition & 1 deletion src/sites/mobile-taro/vue/src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page,
overflow-x: hidden;
overflow-y: auto;
padding: 0 17px 17px 17px;

box-sizing: border-box;
&.full {
padding: 0 0 0 0;
h2 {
Expand Down