feat: 多语言支持 https://github.com/vastsa/FileCodeBox/issues/310 https://github.com/vastsa/FileCodeBox/issues/299
This commit is contained in:
1 parent
f83b3d7152
commit
2e52ed61bd
25 files changed
+1678
-245
No files matched your search
@@ -4,7 +4,7 @@
|
||||
:value="modelValue"
|
||||
@input="updateValue"
|
||||
:rows="rows"
|
||||
:placeholder="placeholder"
|
||||
:placeholder="placeholderText"
|
||||
:class="[
|
||||
'flex-grow px-4 py-3 rounded-xl placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 resize-none custom-scrollbar',
|
||||
isDarkMode
|
||||
@@ -16,7 +16,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { inject } from 'vue'
|
||||
import { inject, computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
interface Props {
|
||||
modelValue: string
|
||||
@@ -28,7 +31,7 @@ interface Emits {
|
||||
'update:modelValue': [value: string]
|
||||
}
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
rows: 7,
|
||||
placeholder: '在此输入要发送的文本...'
|
||||
})
|
||||
@@ -36,6 +39,9 @@ withDefaults(defineProps<Props>(), {
|
||||
const emit = defineEmits<Emits>()
|
||||
const isDarkMode = inject('isDarkMode')
|
||||
|
||||
// 使用computed属性处理多语言文本
|
||||
const placeholderText = computed(() => props.placeholder || t('send.uploadArea.textInput'))
|
||||
|
||||
const updateValue = (event: Event) => {
|
||||
const target = event.target as HTMLTextAreaElement
|
||||
emit('update:modelValue', target.value)
|
||||
|
||||
Reference in new issue
Block a user