refactor: i18n

* refactor: i18n
This commit is contained in:
啝裳
2022-03-11 21:28:43 +08:00
committed by GitHub
parent 8b3f642cf2
commit 494ce8f41b
31 changed files with 608 additions and 479 deletions

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { reactive } from "vue";
import { useI18n } from "vue-i18n";
import { VxeTableEvents } from "vxe-table";
import { templateRef } from "@vueuse/core";
@@ -19,6 +20,8 @@ const emit = defineEmits<{
(e: "handleClose"): void;
}>();
const { t } = useI18n();
const xTable = templateRef<any>("xTable", null);
const configData = reactive({
@@ -140,7 +143,7 @@ const checkboxChangeEvent: VxeTableEvents.CheckboxChange = ({ records }) => {
<span class="select-count"
>已选中{{ configData.selectRecords.length }}</span
>
<vxe-button size="small">{{ $t("buttons.hsdelete") }}</vxe-button>
<vxe-button size="small">{{ t("buttons.hsdelete") }}</vxe-button>
</span>
</template>
</vxe-pager>

View File

@@ -7,6 +7,7 @@ export default {
<script setup lang="ts">
import XEUtils from "xe-utils";
import Config from "./config.vue";
import { useI18n } from "vue-i18n";
import { cloneDeep } from "lodash-unified";
import { templateRef } from "@vueuse/core";
import { reactive, ref, unref, nextTick } from "vue";
@@ -22,6 +23,8 @@ type onEditNRow = {
model: string;
};
const { t } = useI18n();
const dictData = reactive({
submitLoading: false,
showEdit: false,
@@ -209,7 +212,7 @@ function handleClose() {
<template #buttons>
<vxe-input
v-model="dictData.filterName"
:placeholder="$t('buttons.hssearch')"
:placeholder="t('buttons.hssearch')"
@keyup="searchEvent"
></vxe-input>
</template>
@@ -218,19 +221,19 @@ function handleClose() {
icon="fa fa-plus-square-o"
status="primary"
@click="onAdd"
>{{ $t("buttons.hsadd") }}</vxe-button
>{{ t("buttons.hsadd") }}</vxe-button
>
<vxe-button
icon="fa fa-folder-open-o"
status="primary"
@click="$refs.xTree.setAllTreeExpand(true)"
>{{ $t("buttons.hsexpendAll") }}</vxe-button
>{{ t("buttons.hsexpendAll") }}</vxe-button
>
<vxe-button
icon="fa fa-folder-o"
status="primary"
@click="$refs.xTree.clearTreeExpand()"
>{{ $t("buttons.hscollapseAll") }}</vxe-button
>{{ t("buttons.hscollapseAll") }}</vxe-button
>
</template>
</vxe-toolbar>