Merge remote-tracking branch 'origin/feature/v1.3_主agent_rxd' into test

This commit is contained in:
rd
2025-08-29 10:30:24 +08:00
3 changed files with 18 additions and 9 deletions

View File

@ -30,15 +30,20 @@ export default {
const senderRef = ref(null);
const localSearchValue = ref(props.modelValue);
// 监听外部value变化
const isEmptyValue = computed(() => !localSearchValue.value.trim());
watch(
() => props.modelValue,
(newValue) => {
console.log(newValue);
localSearchValue.value = newValue || '';
},
);
const handleSubmit = () => {
if (isEmptyValue.value) {
return;
}
emit('submit', localSearchValue.value);
};
const handleCancel = () => {
@ -64,7 +69,7 @@ export default {
<div
onClick={handleSubmit}
class={`submit-btn w-32px h-32px p-6px flex justify-center items-center rounded-50% cursor-pointer ${
!localSearchValue.value ? 'opacity-50' : ''
isEmptyValue.value ? 'opacity-50' : ''
}`}
>
<icon-arrow-right size={20} class="color-#FFFFFF" />
@ -81,7 +86,7 @@ export default {
<Sender
v-model:value={localSearchValue.value}
ref={senderRef}
onChange={(value: string) => emit('update:modelValue', value)}
onChange={(value: string) => emit('update:modelValue', value.trim())}
onSubmit={handleSubmit}
class="h-full w-full mb-24px"
placeholder={props.placeholder}