Commit 97864cc3 by haojie

1

parent 749753c7
......@@ -5,14 +5,14 @@
:bordered="true"
v-model="locale"
:options="languageOptions"
@Change="changeLanguage"
:onChange="changeLanguage"
:borderless="true"
></t-select>
</div>
</template>
<script lang="ts" setup>
import { useI18n } from '#imports';
import { useI18n } from 'vue-i18n';
const props = defineProps({
type: {
type: String,
......
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { TableSort } from '@/utils/tool';
import { useI18n } from '#imports';
export default function () {
const { t } = useI18n();
const otherLink = ref([
......
import cn from '../language/cn';
import en from '../language/en';
const i18n = {
locales: ['cn', 'en'], //有多少地区的语言就添加多少种
defaultLocale: 'en', //默认的地区语言
vueI18n: {
fallbackLocale: 'en', //回退策略,指定的locale中没有找到对应资源的情况下使用的locale
messages: {
//要渲染的信息,有多少语言就添加多少种
cn: cn,
en: en,
},
},
};
export default i18n;
import viteCompression from 'vite-plugin-compression';
import i18n from './language/i18n';
// 筛选接口地址
let filterApi = 'http://156.247.9.93:9501/';
let loginApi = 'http://156.247.9.93:8001/';
export default defineNuxtConfig({
// plugins: [],
modules: ['nuxt-svgo', '@nuxtjs-alt/proxy', '@nuxtjs/i18n'],
i18n: {
// ...
...i18n,
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
redirectOn: 'root', // recommended
},
},
modules: ['nuxt-svgo', '@nuxtjs-alt/proxy'],
proxy: {
enableProxy: true,
proxies: {
......@@ -80,7 +70,7 @@ export default defineNuxtConfig({
// 第三方插件转es5
transpile:
process.env.NODE_ENV === 'production'
? ['tdesign-vue-next', 'echarts']
? ['tdesign-vue-next', 'echarts', 'vue-i18n']
: ['echarts'],
// cssSourceMap: true,
},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,7 +10,6 @@
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@nuxt/types": "^2.16.0",
"axios": "^0.24.0",
"cross-env": "^7.0.3",
"fontmin": "^0.9.9",
......@@ -22,7 +21,6 @@
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@nuxtjs-alt/proxy": "^2.0.4",
"@nuxtjs/i18n": "^7.3.1",
"echarts": "^5.4.0",
"ethers": "^5.7.2",
"install": "^0.13.0",
......@@ -31,6 +29,7 @@
"qrcode": "^1.5.1",
"tdesign-icons-vue-next": "^0.1.7",
"tdesign-vue-next": "^0.25.0",
"vue-clipboard3": "^1.0.1"
"vue-clipboard3": "^1.0.1",
"vue-i18n": "^9.2.2"
}
}
import { defineNuxtPlugin } from '#app';
import i18n from '@/language/index';
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(i18n);
});
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"types": ["@nuxt/types", "@nuxtjs/i18n"]
}
"extends": "./.nuxt/tsconfig.json"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment