chore: 修正部分代码bug
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
- ProductView中faqs命名错误,修正为ProductQuestionView - 移除useLocalizations中弃置的Strapi语言获取方法
This commit is contained in:
@ -1,4 +1,3 @@
|
|||||||
import type { StrapiLocale } from '@nuxtjs/strapi';
|
|
||||||
import type { Language as ElementLanguage } from 'element-plus/es/locale';
|
import type { Language as ElementLanguage } from 'element-plus/es/locale';
|
||||||
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
||||||
import en from 'element-plus/es/locale/lang/en';
|
import en from 'element-plus/es/locale/lang/en';
|
||||||
@ -8,8 +7,6 @@ import en from 'element-plus/es/locale/lang/en';
|
|||||||
* 用于统一 Strapi / Directus / Element Plus 的多语言配置
|
* 用于统一 Strapi / Directus / Element Plus 的多语言配置
|
||||||
*/
|
*/
|
||||||
export interface LocaleMapping {
|
export interface LocaleMapping {
|
||||||
/** 用于StrapiLocale **/
|
|
||||||
strapi: StrapiLocale;
|
|
||||||
/** 用于Directus translations.languages_code **/
|
/** 用于Directus translations.languages_code **/
|
||||||
directus: string;
|
directus: string;
|
||||||
/** Element Plus语言对象 **/
|
/** Element Plus语言对象 **/
|
||||||
@ -24,12 +21,10 @@ export interface LocaleMapping {
|
|||||||
*/
|
*/
|
||||||
export const localeMap = {
|
export const localeMap = {
|
||||||
zh: {
|
zh: {
|
||||||
strapi: 'zh-CN',
|
|
||||||
directus: 'zh-CN',
|
directus: 'zh-CN',
|
||||||
element: zhCn,
|
element: zhCn,
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
strapi: 'en',
|
|
||||||
directus: 'en-US',
|
directus: 'en-US',
|
||||||
element: en,
|
element: en,
|
||||||
},
|
},
|
||||||
@ -74,8 +69,6 @@ export const useLocalizations = () => {
|
|||||||
return {
|
return {
|
||||||
/** 当前Nuxt I18n语言(只读) **/
|
/** 当前Nuxt I18n语言(只读) **/
|
||||||
locale: readonly(locale),
|
locale: readonly(locale),
|
||||||
/** 获取Strapi的本地化代码 **/
|
|
||||||
getStrapiLocale: (l?: AppLocale) => getMapping(l).strapi,
|
|
||||||
/** 获取Directus的本地化代码 **/
|
/** 获取Directus的本地化代码 **/
|
||||||
getDirectusLocale: (l?: AppLocale) => getMapping(l).directus,
|
getDirectusLocale: (l?: AppLocale) => getMapping(l).directus,
|
||||||
/** 获取Element Plus语言对象 **/
|
/** 获取Element Plus语言对象 **/
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export interface ProductView {
|
|||||||
specs: ProductSpecGroupView[];
|
specs: ProductSpecGroupView[];
|
||||||
|
|
||||||
/** 产品常见问题 **/
|
/** 产品常见问题 **/
|
||||||
faqs: QuestionView[];
|
faqs: ProductQuestionView[];
|
||||||
|
|
||||||
/** 产品文档 **/
|
/** 产品文档 **/
|
||||||
documents: ProductDocumentView[];
|
documents: ProductDocumentView[];
|
||||||
|
|||||||
Reference in New Issue
Block a user