Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
xqz
/
dianDemo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3e329f74
authored
2020-04-17 17:49:39 +0800
by
sunnie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
readme
1 parent
f670c296
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
README.md
README.md
View file @
3e329f7
...
...
@@ -36,8 +36,6 @@
### <span id="env">✅ 配置多环境变量 </span>
  
NODE_ENV 和 BASE_URL 是两个特殊变量,在代码中始终可用
`package.json`
里的
`scripts`
配置
`serve`
`stage`
`build`
,通过
`--mode xxx`
来执行不同环境
-
通过
`npm run serve`
启动本地 , 执行
`development`
...
...
@@ -55,8 +53,8 @@
##### 配置介绍
  
以
`VUE_APP_`
开头的变量,在代码中可以通过
`process.env.VUE_APP_`
访问。
  
比如,
`VUE_APP_ENV = 'development'`
通过
`process.env.VUE_APP_ENV`
访问
  
除了
`VUE_APP_*`
变量之外
,在你的应用代码中始终可用的还有两个特殊的变量
`NODE_ENV`
和
`BASE_URL`
  
比如,
`VUE_APP_ENV = 'development'`
通过
`process.env.VUE_APP_ENV`
访问
  
除了
`VUE_APP_*`
变量之外
,在你的应用代码中始终可用的还有两个特殊的变量
`NODE_ENV`
和
`BASE_URL`
在项目根目录中新建.env
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment