refactor: refs #7069 remove keyup.enter and blur event emissions from VnInput component
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
43258214e1
commit
649686f128
|
@ -6,13 +6,7 @@ import { useRequired } from 'src/composables/useRequired';
|
|||
const $attrs = useAttrs();
|
||||
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits([
|
||||
'update:modelValue',
|
||||
'update:options',
|
||||
'keyup.enter',
|
||||
'remove',
|
||||
'blur',
|
||||
]);
|
||||
const emit = defineEmits(['update:modelValue', 'update:options', 'remove']);
|
||||
|
||||
const $props = defineProps({
|
||||
modelValue: {
|
||||
|
@ -126,6 +120,14 @@ const handleInsertMode = (e) => {
|
|||
const handleUppercase = () => {
|
||||
value.value = value.value?.toUpperCase() || '';
|
||||
};
|
||||
|
||||
const listeners = computed(() =>
|
||||
Object.fromEntries(
|
||||
Object.entries($attrs).filter(
|
||||
([key, val]) => key.startsWith('on') && typeof val === 'function',
|
||||
),
|
||||
),
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -134,10 +136,9 @@ const handleUppercase = () => {
|
|||
ref="vnInputRef"
|
||||
v-model="value"
|
||||
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||
v-on="listeners"
|
||||
:type="$attrs.type"
|
||||
:class="{ required: isRequired }"
|
||||
@keyup.enter="emit('keyup.enter')"
|
||||
@blur="emit('blur')"
|
||||
@keydown="handleKeydown"
|
||||
:clearable="false"
|
||||
:rules="mixinRules"
|
||||
|
|
Loading…
Reference in New Issue