mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-11-29 22:12:11 +08:00
feat(design,tdesign-vue-next-adapter): input添加click事件
This commit is contained in:
parent
489d321677
commit
a96ca8092c
@ -9,6 +9,7 @@
|
||||
@update:modelValue="updateModelValue"
|
||||
@blur="blurHandler"
|
||||
@focus="focusHandler"
|
||||
@click="clickHandler"
|
||||
>
|
||||
<template #prepend v-if="$slots.prepend">
|
||||
<slot name="prepend"></slot>
|
||||
@ -43,7 +44,7 @@ const uiComponent = ui?.component || 'el-input';
|
||||
|
||||
const uiProps = computed<InputProps>(() => ui?.props(props) || props);
|
||||
|
||||
const emit = defineEmits(['change', 'input', 'blur', 'focus', 'update:modelValue']);
|
||||
const emit = defineEmits(['change', 'input', 'blur', 'focus', 'click', 'update:modelValue']);
|
||||
|
||||
const instance = ref<any>();
|
||||
|
||||
@ -67,6 +68,10 @@ const focusHandler = (...args: any[]) => {
|
||||
emit('focus', ...args);
|
||||
};
|
||||
|
||||
const clickHandler = (...args: any[]) => {
|
||||
emit('click', ...args);
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
instance,
|
||||
getInput() {
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
@change="changeHandler"
|
||||
@blur="blurHandler"
|
||||
@focus="focusHandler"
|
||||
@click="clickHandler"
|
||||
@update:modelValue="updateModelValue"
|
||||
></TTextarea>
|
||||
<TInputAdornment v-else>
|
||||
@ -31,6 +32,7 @@
|
||||
@change="changeHandler"
|
||||
@blur="blurHandler"
|
||||
@focus="focusHandler"
|
||||
@click="clickHandler"
|
||||
@update:modelValue="updateModelValue"
|
||||
>
|
||||
<template #prefix-icon v-if="$slots.prefix">
|
||||
@ -59,7 +61,7 @@ const props = defineProps<
|
||||
}
|
||||
>();
|
||||
|
||||
const emit = defineEmits(['change', 'input', 'blur', 'focus', 'update:modelValue']);
|
||||
const emit = defineEmits(['change', 'input', 'blur', 'focus', 'click', 'update:modelValue']);
|
||||
|
||||
const textareaRef = useTemplateRef('textarea');
|
||||
|
||||
@ -92,6 +94,10 @@ const focusHandler = (...args: any[]) => {
|
||||
emit('focus', ...args);
|
||||
};
|
||||
|
||||
const clickHandler = (...args: any[]) => {
|
||||
emit('click', ...args);
|
||||
};
|
||||
|
||||
const updateModelValue = (...args: any[]) => {
|
||||
emit('update:modelValue', ...args);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user