【issues/7664】JVxeTable的textarea组件@blur会重复发生 ---

pull/7765/head^2
JEECG 2025-01-13 20:23:56 +08:00
parent a00e4684b5
commit 17dc1916aa
1 changed files with 7 additions and 3 deletions

View File

@ -13,9 +13,9 @@
</span> </span>
</template> </template>
<template #content> <template #content>
<a-textarea ref="textareaRef" :value="innerValue" :disabled="disabled" :style="textareaStyle" v-bind="attrs" @input="onInputChange" /> <a-textarea ref="textareaRef" :value="innerValue" :disabled="disabled" :style="textareaStyle" v-bind="attrs" @input="onInputChange" @blur="onInputBlur" />
</template> </template>
<a-input :class="`${prefixCls}-input`" :value="innerValue" :disabled="disabled" v-bind="attrs" @change="onInputChange"> <a-input :class="`${prefixCls}-input`" :value="innerValue" :disabled="disabled" v-bind="attrs" @change="onInputChange" @blur="onInputBlur">
<template #suffix> <template #suffix>
<Icon icon="ant-design:fullscreen-outlined" @click.stop="onShowPopup" /> <Icon icon="ant-design:fullscreen-outlined" @click.stop="onShowPopup" />
</template> </template>
@ -44,7 +44,7 @@
popContainer: propTypes.oneOfType([propTypes.string, propTypes.func]).def(''), popContainer: propTypes.oneOfType([propTypes.string, propTypes.func]).def(''),
}); });
const attrs = useAttrs(); const attrs = useAttrs();
const emit = defineEmits(['change', 'update:value']); const emit = defineEmits(['change', 'update:value', 'blur']);
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
const innerValue = ref<string>(''); const innerValue = ref<string>('');
@ -92,6 +92,10 @@
emit('change', value); emit('change', value);
emit('update:value', value); emit('update:value', value);
} }
const onInputBlur = (event) => {
emit('blur', event);
}
</script> </script>
<style lang="less"> <style lang="less">