mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-01-26 11:51:28 +00: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"
|
@update:modelValue="updateModelValue"
|
||||||
@blur="blurHandler"
|
@blur="blurHandler"
|
||||||
@focus="focusHandler"
|
@focus="focusHandler"
|
||||||
|
@click="clickHandler"
|
||||||
>
|
>
|
||||||
<template #prepend v-if="$slots.prepend">
|
<template #prepend v-if="$slots.prepend">
|
||||||
<slot name="prepend"></slot>
|
<slot name="prepend"></slot>
|
||||||
@ -43,7 +44,7 @@ const uiComponent = ui?.component || 'el-input';
|
|||||||
|
|
||||||
const uiProps = computed<InputProps>(() => ui?.props(props) || props);
|
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>();
|
const instance = ref<any>();
|
||||||
|
|
||||||
@ -67,6 +68,10 @@ const focusHandler = (...args: any[]) => {
|
|||||||
emit('focus', ...args);
|
emit('focus', ...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const clickHandler = (...args: any[]) => {
|
||||||
|
emit('click', ...args);
|
||||||
|
};
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
instance,
|
instance,
|
||||||
getInput() {
|
getInput() {
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
@change="changeHandler"
|
@change="changeHandler"
|
||||||
@blur="blurHandler"
|
@blur="blurHandler"
|
||||||
@focus="focusHandler"
|
@focus="focusHandler"
|
||||||
|
@click="clickHandler"
|
||||||
@update:modelValue="updateModelValue"
|
@update:modelValue="updateModelValue"
|
||||||
></TTextarea>
|
></TTextarea>
|
||||||
<TInputAdornment v-else>
|
<TInputAdornment v-else>
|
||||||
@ -31,6 +32,7 @@
|
|||||||
@change="changeHandler"
|
@change="changeHandler"
|
||||||
@blur="blurHandler"
|
@blur="blurHandler"
|
||||||
@focus="focusHandler"
|
@focus="focusHandler"
|
||||||
|
@click="clickHandler"
|
||||||
@update:modelValue="updateModelValue"
|
@update:modelValue="updateModelValue"
|
||||||
>
|
>
|
||||||
<template #prefix-icon v-if="$slots.prefix">
|
<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');
|
const textareaRef = useTemplateRef('textarea');
|
||||||
|
|
||||||
@ -92,6 +94,10 @@ const focusHandler = (...args: any[]) => {
|
|||||||
emit('focus', ...args);
|
emit('focus', ...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const clickHandler = (...args: any[]) => {
|
||||||
|
emit('click', ...args);
|
||||||
|
};
|
||||||
|
|
||||||
const updateModelValue = (...args: any[]) => {
|
const updateModelValue = (...args: any[]) => {
|
||||||
emit('update:modelValue', ...args);
|
emit('update:modelValue', ...args);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user