refactor(editor): Rename $emits to emits where we use defineEmits (no-changelog) (#9959)
This commit is contained in:
@@ -157,7 +157,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
tagSize: 'small',
|
||||
});
|
||||
|
||||
const $emit = defineEmits<{
|
||||
const emit = defineEmits<{
|
||||
validate: [shouldValidate: boolean];
|
||||
'update:modelValue': [value: Validatable];
|
||||
focus: [];
|
||||
@@ -217,22 +217,22 @@ function getInputValidationError(): ReturnType<IValidator['validate']> {
|
||||
function onBlur() {
|
||||
state.hasBlurred = true;
|
||||
state.isTyping = false;
|
||||
$emit('blur');
|
||||
emit('blur');
|
||||
}
|
||||
|
||||
function onUpdateModelValue(value: Validatable) {
|
||||
state.isTyping = true;
|
||||
$emit('update:modelValue', value);
|
||||
emit('update:modelValue', value);
|
||||
}
|
||||
|
||||
function onFocus() {
|
||||
$emit('focus');
|
||||
emit('focus');
|
||||
}
|
||||
|
||||
function onEnter(event: Event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
$emit('enter');
|
||||
emit('enter');
|
||||
}
|
||||
|
||||
const validationError = computed<string | null>(() => {
|
||||
@@ -258,14 +258,14 @@ const showErrors = computed(
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
$emit('validate', !validationError.value);
|
||||
emit('validate', !validationError.value);
|
||||
|
||||
if (props.focusInitially && inputRef.value) inputRef.value.focus();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => validationError.value,
|
||||
(error) => $emit('validate', !error),
|
||||
(error) => emit('validate', !error),
|
||||
);
|
||||
|
||||
defineExpose({ inputRef });
|
||||
|
||||
Reference in New Issue
Block a user