Nenhuma descrição

zhuxc 33a1cc24c6 add vue install js 5 anos atrás
build df72bc29c2 tweak title 6 anos atrás
config 451a359f13 chore: set default assetsPublicPath to '/' 6 anos atrás
src 33a1cc24c6 add vue install js 5 anos atrás
static c528bd8ad0 init 7 anos atrás
.babelrc 15edbf08be rm babel-plugin-dynamic-import-node 6 anos atrás
.editorconfig 972b305e48 add editorconfig 7 anos atrás
.eslintignore c528bd8ad0 init 7 anos atrás
.eslintrc.js 5d769533ac add: eslint-plugin-vue (#148) 6 anos atrás
.gitignore cade4f9449 refactor build 6 anos atrás
.postcssrc.js 3c75eb6dde refine code 6 anos atrás
.travis.yml 2325e7651b perf[chore]:set travis notifications:false 6 anos atrás
LICENSE 374bf49c6c update LICENSE 6 anos atrás
README-zh.md 364ee5fee7 update readme 6 anos atrás
README.md 364ee5fee7 update readme 6 anos atrás
favicon.ico 29ec7f8a18 feat:add showPwd 6 anos atrás
index.html cade4f9449 refactor build 6 anos atrás
package.json 540c6b83f9 update package.json 5 anos atrás

README-zh.md

vue-admin-template

这是一个 极简的 vue admin 管理后台 它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。

线上地址

国内访问

Extra

如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用改分支permission-control

本项目基于webpack4开发,若还想使用webpack3开发,请使用该分支webpack3

如果你想使用基于 vue + typescript 的管理后台, 可以看看这个项目: vue-typescript-admin-template (鸣谢: @Armour)

相关项目

vue-element-admin

electron-vue-admin

vue-typescript-admin-template

写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目:

Build Setup

# Clone project
git clone https://github.com/PanJiaChen/vue-admin-template.git

# Install dependencies
npm install

# 建议不要用cnpm  安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题
npm install --registry=https://registry.npm.taobao.org

# Serve with hot reload at localhost:9528
npm run dev

# Build for production with minification
npm run build

# Build for production and view the bundle analyzer report
npm run build --report

Demo

demo

Element-Ui 使用 cdn 教程

首先找到 index.html (根目录下)

引入 Element 的 css 和 js ,并且引入 vue 。因为 Element-Ui 是依赖 vue 的,所以必须在它之前引入 vue 。

之后找到 webpack.base.conf.js 加入 externals 让 webpack 不打包 vue 和 element

externals: {
  vue: 'Vue',
  'element-ui':'ELEMENT'
}

之后还有一个小细节是如果你用了全局对象方式引入 vue,就不需要 手动 Vue.use(Vuex) ,它会自动挂载,具体见 issue

最终你可以使用 npm run build --report 查看效果 如图: demo

具体代码

对应分支

Browsers support

Modern browsers and Internet Explorer 10+.

IE / EdgeFirefoxChrome
IE / Edge
Firefox
Chrome
SafariSafari IE10, IE11, Edge last 2 versions last 2 versions last 2 versions

License

MIT license.

Copyright (c) 2017-present PanJiaChen