Files
oa/documentation/plugins/datepicker/datepicker-range-documentation.md
2025-05-24 01:49:48 +09:00

1.8 KiB

state
state
range
start end
2021-02-08 2021-02-14

DateRangepicker

<VCalendar /> can be turned into a date range picker if needed. Check the code example for more details about usage.

<script setup lang="ts">
const range = reactive({
  start: new Date(),
  end: new Date(),
})
</script>

<template>
  <ClientOnly>
    <VDatePicker
      v-model.range="range"
      color="green"
      trim-weeks
    >
      <template #default="{ inputValue, inputEvents }">
        <VField addons>
          <VControl>
            <input
              class="input v-input"
              type="text"
              :value="inputValue.start"
              v-on="inputEvents.start"
            >
          </VControl>
          <VControl>
            <VButton static icon="lucide:arrow-right" />
          </VControl>
          <VControl subcontrol>
            <input
              class="input v-input"
              type="text"
              :value="inputValue.end"
              v-on="inputEvents.end"
            >
          </VControl>
        </VField>
      </template>
    </VDatePicker>
  </ClientOnly>
</template>
to