diff --git a/packages/sula/package.json b/packages/sula/package.json index f44ba33..1ef1a6e 100644 --- a/packages/sula/package.json +++ b/packages/sula/package.json @@ -1,6 +1,6 @@ { "name": "sula", - "version": "1.2.0-beta.55", + "version": "1.2.0-beta.56", "module": "./es/index.js", "main": "./es/index.js", "types": "./es/index.d.ts", diff --git a/packages/sula/src/template-create-form/index.ts b/packages/sula/src/template-create-form/index.ts index 99bcdc5..d0e9015 100644 --- a/packages/sula/src/template-create-form/index.ts +++ b/packages/sula/src/template-create-form/index.ts @@ -1,5 +1 @@ -import { default as _CreateForm, CreateFormProps as _CreateFormProps } from './CreateForm'; - -export interface CreateFormProps extends _CreateFormProps {} - -export const CreateForm = _CreateForm; \ No newline at end of file +export { default as CreateForm } from './CreateForm'; \ No newline at end of file diff --git a/packages/sula/src/template-query-table/index.ts b/packages/sula/src/template-query-table/index.ts index 7835174..611aea4 100644 --- a/packages/sula/src/template-query-table/index.ts +++ b/packages/sula/src/template-query-table/index.ts @@ -1,4 +1,2 @@ -import { default as QueryTable, QueryTableProps } from './QueryTable'; -import { default as QueryForm, QueryFormProps } from './QueryForm'; - -export { QueryTable, QueryForm, QueryTableProps, QueryFormProps }; +export { default as QueryTable } from './QueryTable'; +export { default as QueryForm } from './QueryForm'; diff --git a/packages/sula/src/template-step-form/index.ts b/packages/sula/src/template-step-form/index.ts index efd8078..a914fd3 100644 --- a/packages/sula/src/template-step-form/index.ts +++ b/packages/sula/src/template-step-form/index.ts @@ -1,5 +1 @@ -import { default as _StepForm, StepFormProps as _StepFormProps } from './StepForm'; - -export interface StepFormProps extends _StepFormProps {} - -export const StepForm = _StepForm; \ No newline at end of file +export { default as StepForm } from './StepForm'; \ No newline at end of file diff --git a/packages/sula/src/template-step-query-table/index.ts b/packages/sula/src/template-step-query-table/index.ts index 0596fbf..c9ca507 100644 --- a/packages/sula/src/template-step-query-table/index.ts +++ b/packages/sula/src/template-step-query-table/index.ts @@ -1,5 +1 @@ -import { default as _StepQueryTable ,StepQueryTableProps as _StepQueryTableProps } from './StepQueryTable'; - -export interface StepQueryTableProps extends _StepQueryTableProps {} - -export const StepQueryTable = _StepQueryTable; +export { default as StepQueryTable } from './StepQueryTable'; diff --git a/packages/umi-plugin-sula/package.json b/packages/umi-plugin-sula/package.json index 0e464a7..58abfa7 100644 --- a/packages/umi-plugin-sula/package.json +++ b/packages/umi-plugin-sula/package.json @@ -1,6 +1,6 @@ { "name": "umi-plugin-sula", - "version": "1.0.0-beta.1", + "version": "1.0.0-beta.2", "main": "lib/index.js", "peerDependencies": { "sula": "^1.0.0-beta.1", diff --git a/packages/umi-plugin-sula/template/configProvider.js b/packages/umi-plugin-sula/template/configProvider.js index d790737..7ca28ff 100644 --- a/packages/umi-plugin-sula/template/configProvider.js +++ b/packages/umi-plugin-sula/template/configProvider.js @@ -1,12 +1,17 @@ import React from 'react'; import { ConfigProvider } from 'sula'; -import { history } from 'umi'; +import { history, getLocale } from 'umi'; const baseSeparator = '{{{baseSeparator}}}' || '-'; const formatLangFile = (lang) => lang && lang.replace(baseSeparator, '_'); -function getLocale() { - const lang = '{{{default}}}' || `en${baseSeparator}US`; +function getLocaleData() { + let lang; + try { + lang = getLocale(); + } catch (error) { + lang = '{{{default}}}' || `en${baseSeparator}US`; + } const langFile = formatLangFile(lang); let locale; @@ -19,7 +24,7 @@ function getLocale() { export const rootContainer = (container) => { return ( - + {container} );