mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 11:58:10 +08:00
parent
fbeb0bfbb2
commit
ef7e678239
@ -6,8 +6,8 @@ import {isObject, JSONTraverse} from './helper';
|
||||
|
||||
export function replaceText(
|
||||
schema: any,
|
||||
replaceText: {[propName: string]: string},
|
||||
replaceTextIgnoreKeys: String[]
|
||||
replaceText?: {[propName: string]: string},
|
||||
replaceTextIgnoreKeys?: String[]
|
||||
) {
|
||||
// 进行文本替换
|
||||
if (replaceText && isObject(replaceText)) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import {AsideNav, Html, NotFound, Spinner} from 'amis-ui';
|
||||
import {Layout} from 'amis-ui';
|
||||
import {Renderer, RendererProps} from 'amis-core';
|
||||
import {Renderer, RendererProps, replaceText} from 'amis-core';
|
||||
import {
|
||||
BaseSchema,
|
||||
SchemaApi,
|
||||
@ -197,6 +197,10 @@ export default class App extends React.Component<AppProps, object> {
|
||||
|
||||
if (isEffectiveApi(api, store.data)) {
|
||||
const json = await store.fetchInitData(api, store.data, {});
|
||||
if (env.replaceText) {
|
||||
replaceText(json.data, env.replaceText, env.replaceTextIgnoreKeys);
|
||||
}
|
||||
|
||||
if (json?.data.pages) {
|
||||
store.setPages(json.data.pages);
|
||||
store.updateActivePage(env);
|
||||
|
Loading…
Reference in New Issue
Block a user