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(canendar): subtitle supports reactive #12425

Merged
merged 4 commits into from
Nov 5, 2023

Conversation

cc-hearts
Copy link
Contributor

fix: subTitle supports responsive switching when international language changes

close #12423

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
packages/vant/src/calendar/Calendar.tsx 89.81% <100.00%> (+0.14%) ⬆️

... and 2 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@@ -87,7 +88,7 @@ export default defineComponent({

const shouldRender = computed(() => visible.value || !props.lazyRender);

const getTitle = () => title.value;
const getTitle = () => toRef(title, 'value');
Copy link
Member

@chenjiahan chenjiahan Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change? The title param of month-show event is changed.

The previous type was string, but now the type is Ref<string>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a breaking change. the title should change responsively with locale changes.

The title type didn't change, that was my mistake.

@cc-hearts
Copy link
Contributor Author

🤯 I did a lot of breaking change.

For subTitle assignments, use shallowReactive instead of ref. This way subTitle.text can be declared using ref.

@chenjiahan
Copy link
Member

We can not introduce any breaking changes in a minor or patch release, so we can only make forward-compatible changes.

@cc-hearts
Copy link
Contributor Author

Thanks to your suggestion, I removed breaking change.

@chenjiahan chenjiahan merged commit 8079f7c into youzan:main Nov 5, 2023
3 checks passed
@chenjiahan
Copy link
Member

Thanks!

CatsAndMice pushed a commit to CatsAndMice/vant that referenced this pull request Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] Locale.use 无法动态修改 Calendar 组件的 subtitle
3 participants