Skip to content

Commit 7127a5c

Browse files
committed
fix: revise inspection comments
1 parent 60f205c commit 7127a5c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

examples/sites/demos/pc/webdoc/faq-en.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## 1, Popup element misaligned and flipped in wujie micro front-end
44

5-
_Reason:_ The popup element has a boundary detection logic, and in sub applications, the width and height of 'window' may be much smaller than that of the viewport,
5+
**Reason:** The popup element has a boundary detection logic, and in sub applications, the width and height of 'window' may be much smaller than that of the viewport,
66
therefore, it can misjudge boundaries, leading to issues such as flipping and misalignment.
77

8-
_Solution:_ Introducing popup global configuration, assigning the 'window' of the main application to the 'viewportWindow' of the global configuration for boundary judgment
8+
**Solution:** Introducing 'popup global' configuration, assigning the 'window' of the main application to the 'viewportWindow' of the global configuration for boundary judgment
99

1010
```js
1111
import globalConfig from '@opentiny/vue-renderless/common/global'
@@ -17,15 +17,16 @@ if (window.__POWERED_BY_WUJIE__) {
1717
}
1818
```
1919

20-
## 2、In Vitepress, reference the Opentiny component package and use Vitepress to package the command: pnpm docs:build, report errors: ERR_UNSUPPORTED_DIR_IMPORT
20+
## 2、In the 'Vitepress' project, reference the 'opentiny' component package and use the 'Vitepress' packaging command: 'pnpm docs:build' , Causing error: 'ERR_UNSUPPORTED_DIR_IMPORT'
2121

22-
_Reason:_ Using Vitepress packaging, the suffix paths such as js/css related to file references in the component package cannot be found. Causing error: ERR_UNSUPPORTED_DIR_IMPORT
22+
**Reason:** Unable to find the 'js/css/...' files referenced within the component package waiting for suffix path, error statement: 'Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import "xxx" is not supported resolving ES modules imported from xxx/lib/index.js'
2323

24-
_Solution:_ Resolve the error issue by configuring the 'vitepress/config. js' file:
24+
**Solution:** In the '. vitepress/config. js' file, add the following code:
2525

2626
```js
2727
export default defineConfig({
2828
vite: {
29+
// ...
2930
ssr: {
3031
noExternal: [/@opentiny\//]
3132
}

examples/sites/demos/pc/webdoc/faq.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## 1、弹出元素在无界微前端中发生错位、翻转
44

5-
_原因:_ 弹出类的元素,存在一个边界检测逻辑,在子应用中,`window` 的宽高可能会比视口小得多,
5+
**原因:** 弹出类的元素,存在一个边界检测逻辑,在子应用中,`window` 的宽高可能会比视口小得多,
66
因此会错误判断边界,导致翻转和错位等问题。
77

8-
_解决方案:_ 引入 popup 全局配置,将主应用的 `window` 赋值给全局配置的 `viewportWindow` 用于边界判断
8+
**解决方案:** 引入 `popup` 全局配置,将主应用的 `window` 赋值给全局配置的 `viewportWindow` 用于边界判断
99

1010
```js
1111
import globalConfig from '@opentiny/vue-renderless/common/global'
@@ -17,15 +17,16 @@ if (window.__POWERED_BY_WUJIE__) {
1717
}
1818
```
1919

20-
## 2、在vitepress中,引用opentiny组件包,使用vitepress打包命令:pnpm docs:build,报错:ERR_UNSUPPORTED_DIR_IMPORT
20+
## 2、`Vitepress` 项目中,引用 `opentiny` 组件包,使用 `Vitepress` 打包命令:`pnpm docs:build`,导致报错:`ERR_UNSUPPORTED_DIR_IMPORT`
2121

22-
_原因:_ 使用vitepress打包,找不到组件包内文件相关引用的js/css等后缀路径。导致报错:ERR_UNSUPPORTED_DIR_IMPORT
22+
**原因:** 找不到组件包内引用相关文件的 `js/css/...` 等后缀路径,报错语句:`Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import 'xxx' is not supported resolving ES modules imported from xxx/lib/index.js`
2323

24-
_解决方案:_ 通过配置`vitepress/config.js`文件,解决报错问题
24+
**解决方案:**`.vitepress/config.js`文件中,加入以下代码
2525

2626
```js
2727
export default defineConfig({
2828
vite: {
29+
// ...
2930
ssr: {
3031
noExternal: [/@opentiny\//]
3132
}

0 commit comments

Comments
 (0)