feat: use composable to unify logic

This commit is contained in:
Javier Segarra 2024-10-30 08:29:04 +01:00
parent 4de23c31b3
commit 1761cc23e0
3 changed files with 3 additions and 3 deletions

View File

@ -6,9 +6,9 @@ import { useAttrs } from 'vue';
import VnDate from './VnDate.vue';
import { useRequired } from 'src/composables/useRequired';
const $attrs = useAttrs();
const { isRequired, requiredFieldRule } = useRequired($attrs);
const model = defineModel({ type: [String, Date] });
const $attrs = useAttrs();
const { t } = useI18n();
const $props = defineProps({

View File

@ -5,9 +5,9 @@ import { date } from 'quasar';
import VnTime from './VnTime.vue';
import { useRequired } from 'src/composables/useRequired';
const $attrs = useAttrs();
const { isRequired, requiredFieldRule } = useRequired($attrs);
const { t } = useI18n();
const $attrs = useAttrs();
const model = defineModel({ type: String });
const props = defineProps({
timeOnly: {

View File

@ -7,8 +7,8 @@ import { useAttrs } from 'vue';
import { useRequired } from 'src/composables/useRequired';
const { t } = useI18n();
const emit = defineEmits(['update:model-value', 'update:options']);
const { isRequired, requiredFieldRule } = useRequired($attrs);
const $attrs = useAttrs();
const { isRequired, requiredFieldRule } = useRequired($attrs);
const props = defineProps({
location: {
type: Object,