From cf9e7618a96b15a980f4673aee419af18372813b Mon Sep 17 00:00:00 2001 From: winixt Date: Thu, 3 Aug 2023 16:41:03 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=20layout=20=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/reference/plugin/plugins/layout.md | 8 +++++++- packages/fes-template-vite/.fes.js | 3 --- packages/fes-template-vite/src/app.jsx | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/reference/plugin/plugins/layout.md b/docs/reference/plugin/plugins/layout.md index 7498707f..bb1584f3 100644 --- a/docs/reference/plugin/plugins/layout.md +++ b/docs/reference/plugin/plugins/layout.md @@ -220,7 +220,13 @@ export const layout = (layoutConfig, { initialState }) => ({ - **类型**:`String` - **默认值**:默认提供 `fes.js` 的 Logo -- **详情**:Logo 的链接 +- **详情**:Logo 的链接,例如在 public/logo.png 放了一个 logo,可以这么配置([BASE_URL 来自这里](../../../guide/env#process-env)) + +```js +export const layout = { + logo: `${process.env.BASE_URL}logo.png`, +}; +``` ### multiTabs diff --git a/packages/fes-template-vite/.fes.js b/packages/fes-template-vite/.fes.js index b54cd286..e538bd27 100644 --- a/packages/fes-template-vite/.fes.js +++ b/packages/fes-template-vite/.fes.js @@ -71,9 +71,6 @@ export default defineBuildConfig({ ['1', '有效的'], ], }, - viteHtml: { - template: 'hello.html', - }, dynamicImport: true, monacoEditor: { languages: ['javascript', 'typescript', 'html', 'json'], diff --git a/packages/fes-template-vite/src/app.jsx b/packages/fes-template-vite/src/app.jsx index 7ef089ee..4a799098 100644 --- a/packages/fes-template-vite/src/app.jsx +++ b/packages/fes-template-vite/src/app.jsx @@ -23,6 +23,7 @@ export const beforeRender = { }; export const layout = { + logo: `${process.env.BASE_URL}wine-outline.svg`, renderCustom: (props) => { console.log(props); return ;