Giter Club home page Giter Club logo

nuxt-element-dashboard's Introduction

nuxt2 + element dashboard

Docs

For detailed explanation on how things work, checkout the Nuxt.js docs.

Script

# install dependencies
$ yarn

# serve with hot reload at localhost:3000
# using mock api to develop
$ yarn mock

# using mock api to develop which doesn't need login
$ yarn mock:nologin

# using backend api to develop
$ yarn dev

# build for production
$ yarn build

环境变量

使用.env设置环境变量, 即在项目根目录新建一个.env文件, 填写环境变量即可。

.env文件示例:

# 左边是变量名(一般大写,下划线分割单词),右边是变量值 
# 注意=号两边不能有空格
TESTING_VAR=just-fot-testing
ANOTHER_VAR=another

可以在项目的vue文件或js文件中读取

mounted() {
  console.log(process.env.TESTING_VAR) // 输出 just-fot-testing
}

工程自带的环境变量

# axios的baseURL,可不传。不传时,则使用相对路径发送请求
API_SERVER=
# 对应webpack的publicPath,一定要/结尾
PUBLIC_PATH=
# 传1则不会有登录拦截
NO_LOGIN=

构建

构建默认生成的是hash路由模式的spa

命令如下:

yarn build

构建必传的环境变量有:

PUBLIC_PATH=

nuxt-element-dashboard's People

Contributors

alvin-liu avatar chenedgar avatar lujunwei avatar pepperyan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.