Created
January 20, 2023 07:17
-
-
Save umair-mirza/e7c2de2dfab4d3dfed450008e413bb6f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup lang="ts"> | |
const { modelValue } = defineProps<{ | |
modelValue: string | |
}>() | |
const emit = defineEmits<{ | |
(e: 'update:modelValue', value: string): void | |
}>() | |
const date = computed({ | |
get() { | |
return modelValue | |
}, | |
set(value: string) { | |
emit('update:modelValue', value) | |
}, | |
}) | |
</script> | |
<template> | |
<div class="q-pa-md" style="max-width: 300px"> | |
<q-input v-model="date" filled> | |
<template #prepend> | |
<q-icon name="event" class="cursor-pointer"> | |
<q-popup-proxy cover transition-show="scale" transition-hide="scale"> | |
<q-date v-model="date" mask="YYYY-MM-DD HH:mm"> | |
<div class="row items-center justify-end"> | |
<q-btn v-close-popup label="Close" color="primary" flat /> | |
</div> | |
</q-date> | |
</q-popup-proxy> | |
</q-icon> | |
</template> | |
<template #append> | |
<q-icon name="access_time" class="cursor-pointer"> | |
<q-popup-proxy cover transition-show="scale" transition-hide="scale"> | |
<q-time v-model="date" mask="YYYY-MM-DD HH:mm" format24h> | |
<div class="row items-center justify-end"> | |
<q-btn v-close-popup label="Close" color="primary" flat /> | |
</div> | |
</q-time> | |
</q-popup-proxy> | |
</q-icon> | |
</template> | |
</q-input> | |
</div> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment