Skip to content

Commit

Permalink
docs(zh): update example format (#5209)
Browse files Browse the repository at this point in the history
  • Loading branch information
defead committed Feb 24, 2020
1 parent 677e4c5 commit b08c10f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/zh/guide/mode-and-env.md
Expand Up @@ -86,7 +86,14 @@ console.log(process.env.VUE_APP_SECRET)
所有解析出来的环境变量都可以在 `public/index.html` 中以 [HTML 插值](./html-and-static-assets.md#插值)中介绍的方式使用。

::: tip 提示
你可以在 `vue.config.js` 文件中计算环境变量。它们仍然需要以 `VUE_APP_` 前缀开头。这可以用于版本信息 `process.env.VUE_APP_VERSION = require('./package.json').version`
你可以在 `vue.config.js` 文件中计算环境变量。它们仍然需要以 `VUE_APP_` 前缀开头。这可以用于版本信息:
```js
process.env.VUE_APP_VERSION = require('./package.json').version

module.exports = {
// config
}
```
:::

## 只在本地有效的变量
Expand Down

0 comments on commit b08c10f

Please sign in to comment.