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

docs(Calendar): add "With external controls" example #3793

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from

Conversation

EvanSchleret
Copy link

πŸ”— Linked issue

#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
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.

2 participants