Skip to content

Commit

Permalink
docs: added usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
samk-dev committed Jun 19, 2023
1 parent da02e85 commit 569f306
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,39 @@ export default defineNuxtConfig({

That's it! You can now use Nuxt VCalendar in your Nuxt app ✨

## Usage Example

**VCalendar does not work on ssr it should be wrapped with `<ClientOnly />`. If you have `ssr: false` it can be used without `<ClientOnly />`** _see [issue on vcalendar repository](https://github.com/nathanreyes/v-calendar/issues/823)_

```html
<script setup lang="ts">
import { ref } from '#imports'
const date = ref(new Date())
const attrs = ref([
{
key: 'today',
highlight: {
color: 'green',
fillMode: 'solid'
},
dates: new Date()
}
])
</script>

<template>
<div>
<client-only>
<h2>Calendar</h2>
<VCalendar v-model="date" />
<h2>Date Picker</h2>
<VDatePicker v-model="date" :attributes="attrs" />
</client-only>
</div>
</template>
```

## Module Options

```ts
Expand Down

0 comments on commit 569f306

Please sign in to comment.