Skip to content

Conversation

@EvanSchleret
Copy link
Contributor

@EvanSchleret EvanSchleret commented Apr 4, 2025

πŸ”— Linked issue

Resolves #3764

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This example clearly demonstrates how to externally control the <UCalendar> component by directly manipulating the date passed into v-model.

The two <UButton> elements call date.subtract({ months: 1 }) and date.add({ months: 1 }) respectively. These methods operate on the CalendarDate instance wrapped in a ref, allowing reactive updates.

Since v-model="date" binds the calendar’s state to this reactive reference, any modification via the buttons is immediately reflected in the UCalendar.

This provides a straightforward and clean way to implement external navigation controls without relying on the internal calendar UI elements.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@benjamincanac benjamincanac added the v3 #1289 label Apr 4, 2025
@benjamincanac benjamincanac changed the title docs(Calendar): add "With external controls" example docs(calendar): add external controls example Apr 22, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 22, 2025

npm i https://pkg.pr.new/@nuxt/ui@3793

commit: b6d00f8

@benjamincanac benjamincanac merged commit 13c2995 into nuxt:v3 Apr 22, 2025
5 checks passed
@benjamincanac
Copy link
Member

Thanks! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 #1289

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to control Calendar outside the component

2 participants