feat: use composable to unify logic
This commit is contained in:
parent
4de23c31b3
commit
1761cc23e0
|
@ -6,9 +6,9 @@ import { useAttrs } from 'vue';
|
||||||
import VnDate from './VnDate.vue';
|
import VnDate from './VnDate.vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
|
|
||||||
|
const $attrs = useAttrs();
|
||||||
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
||||||
const model = defineModel({ type: [String, Date] });
|
const model = defineModel({ type: [String, Date] });
|
||||||
const $attrs = useAttrs();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
|
|
@ -5,9 +5,9 @@ import { date } from 'quasar';
|
||||||
import VnTime from './VnTime.vue';
|
import VnTime from './VnTime.vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
|
|
||||||
|
const $attrs = useAttrs();
|
||||||
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const $attrs = useAttrs();
|
|
||||||
const model = defineModel({ type: String });
|
const model = defineModel({ type: String });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
timeOnly: {
|
timeOnly: {
|
||||||
|
|
|
@ -7,8 +7,8 @@ import { useAttrs } from 'vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const emit = defineEmits(['update:model-value', 'update:options']);
|
const emit = defineEmits(['update:model-value', 'update:options']);
|
||||||
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
|
||||||
const $attrs = useAttrs();
|
const $attrs = useAttrs();
|
||||||
|
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
location: {
|
location: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|
Loading…
Reference in New Issue