fix: inheritAttrs false, remove duplicated nextTick

This commit is contained in:
Sadegh Barati 2023-10-13 22:15:25 +03:30
parent 41756464e9
commit 148fde4c5c
2 changed files with 8 additions and 2 deletions

View File

@ -7,6 +7,10 @@ import { computed, nextTick, onMounted, ref } from 'vue'
import { buttonVariants } from '../button'
import { cn } from '@/lib/utils'
defineOptions({
inheritAttrs: false,
})
const props = withDefaults(defineProps<{
modelValue?: string | number | Date | Partial<{
start: Date
@ -41,7 +45,6 @@ function handleNav(direction: 'prev' | 'next') {
}
onMounted(async () => {
await nextTick()
await nextTick()
if (modelValue.value instanceof Date && calendarRef.value)
calendarRef.value.focusDate(modelValue.value)

View File

@ -7,6 +7,10 @@ import { computed, nextTick, onMounted, ref } from 'vue'
import { buttonVariants } from '../button'
import { cn } from '@/lib/utils'
defineOptions({
inheritAttrs: false,
})
const props = withDefaults(defineProps< {
modelValue?: string | number | Date | Partial<{
start: Date
@ -41,7 +45,6 @@ function handleNav(direction: 'prev' | 'next') {
}
onMounted(async () => {
await nextTick()
await nextTick()
if (modelValue.value instanceof Date && calendarRef.value)
calendarRef.value.focusDate(modelValue.value)