From 6ff29aed853956c332fb86eea7a0f9725df8797d Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 29 Jun 2023 14:32:06 +0800 Subject: [PATCH] docs(html): add example for Scripts component (#4090) --- .../docs/en/guides/basic-features/html.mdx | 83 +++++++++++-------- .../docs/zh/guides/basic-features/html.mdx | 78 ++++++++++------- 2 files changed, 99 insertions(+), 62 deletions(-) diff --git a/packages/document/main-doc/docs/en/guides/basic-features/html.mdx b/packages/document/main-doc/docs/en/guides/basic-features/html.mdx index 2d74ae976b87..0bd8ae432dc4 100644 --- a/packages/document/main-doc/docs/en/guides/basic-features/html.mdx +++ b/packages/document/main-doc/docs/en/guides/basic-features/html.mdx @@ -2,6 +2,7 @@ title: HTML Template sidebar_position: 9 --- + # HTML Template Modern.js provides **JSX syntax** and **HTML(EJS) syntax** to customize the HTML template. @@ -44,7 +45,7 @@ import { Html, Body, Root, Head, Scripts } from '@modern-js/runtime/document'; - `Head`: provide the ability of native Head Element and automatically fills in `` and `` components. -- `Scripts`: provide the ability to adjust the position of script tags injected into the HTML during the build process. By default, it is placed in the `` component. +- `Scripts`: Used to control the placement of the ` - - - + - + - +
- -

Some Params:

-

entryName:sub

-

title:

-

rootId: root

+ +

Some Params:

+

entryName: main

+

title:

+

rootId: root

bottom

- - + +``` + +### Scripts Component Example +You can use the `` component to insert the ` - - + - +
- -

以下为构建时传过来的参数:

-

entryName:sub

-

title:

-

rootId: root

+ +

以下为构建时传过来的参数:

+

entryName: sub

+

title:

+

rootId: root

bottom

- - + +``` + +### Scripts 组件示例 + +你可以使用 `` 组件,将构建生成的 `