Skip to content

Commit b08c10f

Browse files
authored
docs(zh): update example format (#5209)
1 parent 677e4c5 commit b08c10f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/zh/guide/mode-and-env.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,14 @@ console.log(process.env.VUE_APP_SECRET)
8686
所有解析出来的环境变量都可以在 `public/index.html` 中以 [HTML 插值](./html-and-static-assets.md#插值)中介绍的方式使用。
8787

8888
::: tip 提示
89-
你可以在 `vue.config.js` 文件中计算环境变量。它们仍然需要以 `VUE_APP_` 前缀开头。这可以用于版本信息 `process.env.VUE_APP_VERSION = require('./package.json').version`
89+
你可以在 `vue.config.js` 文件中计算环境变量。它们仍然需要以 `VUE_APP_` 前缀开头。这可以用于版本信息:
90+
```js
91+
process.env.VUE_APP_VERSION = require('./package.json').version
92+
93+
module.exports = {
94+
// config
95+
}
96+
```
9097
:::
9198

9299
## 只在本地有效的变量

0 commit comments

Comments
 (0)