From 115aa9d079b3a662d5c52e2f3e7875707e7cbd07 Mon Sep 17 00:00:00 2001 From: Lykin <137850705+tiny-craft@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:13:13 +0800 Subject: [PATCH] refactor: move i18n calling out of computed --- .../components/common/DropdownSelector.vue | 8 +-- frontend/src/components/common/IconButton.vue | 6 +- frontend/src/components/common/TtlInput.vue | 18 ++--- .../src/components/content/ContentLogPane.vue | 11 +-- .../components/content_value/ContentSlog.vue | 8 +-- .../content_value/ContentToolbar.vue | 4 +- .../content_value/ContentValueHash.vue | 6 +- .../content_value/ContentValueList.vue | 4 +- .../content_value/ContentValueSet.vue | 4 +- .../content_value/ContentValueStream.vue | 4 +- .../content_value/ContentValueZSet.vue | 6 +- .../components/dialogs/AddFieldsDialog.vue | 12 ++-- .../components/dialogs/ConnectionDialog.vue | 12 +++- .../src/components/dialogs/GroupDialog.vue | 2 +- .../components/dialogs/ImportKeyDialog.vue | 26 ++++--- .../components/dialogs/KeyFilterDialog.vue | 9 +-- .../components/dialogs/PreferencesDialog.vue | 18 +++-- .../src/components/dialogs/SetTtlDialog.vue | 20 +++--- .../src/components/new_value/AddHashValue.vue | 8 +-- .../src/components/new_value/AddListValue.vue | 8 +-- .../src/components/new_value/AddZSetValue.vue | 8 +-- .../src/components/sidebar/BrowserPane.vue | 16 ++--- .../src/components/sidebar/BrowserTree.vue | 67 ++++++------------- .../src/components/sidebar/ConnectionTree.vue | 51 +++++++------- frontend/src/components/sidebar/Ribbon.vue | 31 ++++----- frontend/src/stores/preferences.js | 10 +-- frontend/src/utils/render.js | 21 ++++-- 27 files changed, 197 insertions(+), 201 deletions(-) diff --git a/frontend/src/components/common/DropdownSelector.vue b/frontend/src/components/common/DropdownSelector.vue index 5b3a9e5..cd97984 100644 --- a/frontend/src/components/common/DropdownSelector.vue +++ b/frontend/src/components/common/DropdownSelector.vue @@ -2,6 +2,7 @@ import { computed, h, ref } from 'vue' import { get, map } from 'lodash' import { NIcon, NText } from 'naive-ui' +import { useRender } from '@/utils/render.js' const props = defineProps({ value: { @@ -21,15 +22,12 @@ const props = defineProps({ }) const emit = defineEmits(['update:value']) +const render = useRender() const renderHeader = () => { return h('div', { class: 'type-selector-header' }, [h(NText, null, () => props.tooltip)]) } -const renderLabel = (option) => { - return h('div', { class: 'type-selector-item' }, option.label) -} - const dropdownOption = computed(() => { const options = [ { @@ -71,7 +69,7 @@ const onDropdownShow = (show) => { {