clear
Former-commit-id: e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly 5793d72d458b7eeaf28a097d026168cebc9fc256 [formerly 9c8de3644bd40a55711e618742e29cce390e4c5f]]]]] Former-commit-id: 05ca3c8da65f8583c142720628aa6ea71d2dbf45 Former-commit-id: 7a4d2fba696e901db86071ea2810e9c932c976ad Former-commit-id: c18d3689200ca0e528fbf9bf171f6e1b50131bc3 [formerly 455e9952ca890cd8ad882250cfb9eabd944d44ee] Former-commit-id: 021fa8191681fe4f22e9a9f40389831a847e9066 Former-commit-id: 1022b7792417ce366901b9d5284762a015dd6d26 Former-commit-id: bed799410be508713cac76b7c8cf02d4457fe996 Former-commit-id: f6787cfaac3404132ad1011e2707e08484708ca9 Former-commit-id: 7a8a3baca9ef30393744fd56def6d608b51dcddd
12
.babelrc
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
}
|
||||
}],
|
||||
"stage-2"
|
||||
],
|
||||
"plugins": ["transform-vue-jsx", "transform-runtime"]
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
/build/
|
||||
/config/
|
||||
/dist/
|
||||
/*.js
|
||||
/src/plugin/vue-bigdata-table
|
||||
/src/pages/demo/charts
|
||||
25
.eslintrc.js
|
|
@ -1,25 +0,0 @@
|
|||
// https://eslint.org/docs/user-guide/configuring
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: 'babel-eslint',
|
||||
parserOptions: {
|
||||
sourceType: 'module'
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
|
||||
extends: 'standard',
|
||||
// required to lint *.vue files
|
||||
plugins: [
|
||||
'html'
|
||||
],
|
||||
// add your custom rules here
|
||||
rules: {
|
||||
// allow async-await
|
||||
'generator-star-spacing': 'off',
|
||||
// allow debugger during development
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
*.css linguist-language=JavaScript
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
.DS_Store
|
||||
node_modules/
|
||||
/dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
*.sketch
|
||||
/docs/.vuepress/dist/
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
other
|
||||
package-lock.json
|
||||
design
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||
|
||||
module.exports = {
|
||||
"plugins": {
|
||||
// to edit target browsers: use "browserslist" field in package.json
|
||||
"postcss-import": {},
|
||||
"autoprefixer": {}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"files.exclude": {}
|
||||
}
|
||||
21
LICENSE
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 李杨
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
101
README.md
|
|
@ -1,101 +0,0 @@
|
|||
D2Admin 是一个开源的管理系统前端集成方案,为了方便开发者快速进行管理系统开发而设计
|
||||
|
||||
## 仓库和文档
|
||||
|
||||
本项目仓库在 Github 和 Gitee 同步发布
|
||||
|
||||
[中文文档](http://d2admin.fairyever.com/zh/)
|
||||
|
||||
**完整版**
|
||||
|
||||
[Github 仓库](https://github.com/d2-projects/d2-admin) |
|
||||
[码云仓库](https://gitee.com/fairyever/d2-admin) |
|
||||
[预览地址](https://fairyever.gitee.io/d2-admin-preview)
|
||||
|
||||
**简化版模板**
|
||||
|
||||
[Github 仓库](https://github.com/d2-projects/d2-admin-start-kit) |
|
||||
[码云仓库](https://gitee.com/fairyever/d2-admin-start-kit) |
|
||||
[预览地址](https://fairyever.gitee.io/d2-admin-start-kit-preview/#/index)
|
||||
|
||||
因为现在集成了很多的插件和组件,首次加载会占用很多的时间,虽然已经做了首屏加载动画,但还是建议您在发布之前一定要删除没有用到的代码,比如项目没有用到图表、示例、插件组件
|
||||
|
||||
<img src="https://raw.githubusercontent.com/FairyEver/d2-admin/master/github/preview@2x.png"/>
|
||||
|
||||
## 功能
|
||||
|
||||
* 首屏加载等待动画 避免首次加载白屏尴尬
|
||||
* 简约主题
|
||||
* 每个插件和组件都配有介绍文档
|
||||
* 图片资源 sketch 源文件( 可以在这个文件内重新生成所有图片资源 )
|
||||
* 登陆和注销
|
||||
* 根据路由自动生成菜单
|
||||
* 可折叠侧边栏
|
||||
* 方便的菜单设置
|
||||
* 多国语言支持
|
||||
* 富文本编辑器
|
||||
* Markdown 编辑器
|
||||
* 全屏功能
|
||||
* Fontawesome 图标库
|
||||
* 图标选择器(组件)
|
||||
* 自动引入下载的 SVG 图标
|
||||
* 前端假数据支持( mock )
|
||||
* 集成蚂蚁金服出品的 G2 图表
|
||||
* 图表自适应可拖拽大小的卡片容器(示例)
|
||||
* 简化剪贴板操作
|
||||
* 简化Cookie操作
|
||||
* 时间日期计算工具
|
||||
* 导入 Excel ( xlsx 格式 + csv 格式 )
|
||||
* 数据导出 Excel ( xlsx 格式 + csv 格式 )
|
||||
* 数据导出文本
|
||||
* 数字动画
|
||||
* 可拖拽调整大小的切分布局
|
||||
* 可拖拽调整大小和位置的网格布局
|
||||
* 提供三种方便的页面容器组件(正常卡片,隐形容器,填满页面)
|
||||
* 代码高亮显示
|
||||
* 加载并解析(或者直接指定资源) markdown 文件
|
||||
* GitHub 样式的 markdown 显示组件
|
||||
* markdown 内代码高亮
|
||||
* 为 markdown 扩展了百度云链接解析和优化显示
|
||||
* 右键菜单组件
|
||||
* 自定义滚动条和滚动控制
|
||||
* 内置5种主题
|
||||
* 公用样式抽离,方便的主题定制
|
||||
* 支持百万级数据量的表格组件
|
||||
* 打包后随意目录部署(已经做好兼容设置)
|
||||
* 支持临时菜单配置
|
||||
* 提供“试验台”功能 方便展示系统功能调用方法 `1.1.4 +`
|
||||
* 多标签页模式 `1.1.4 +`
|
||||
* 美化滚动条 `1.1.4 +`
|
||||
* 持久化存储 `1.1.4 +`
|
||||
|
||||
## 加入小组
|
||||
|
||||
D2Admin 是完全开源免费的管理系统集成方案,由 [FairyEver](https://github.com/FairyEver) 在工作之余完全由兴趣驱动完成,如果你也一样喜欢前端开发,欢迎加入我们的讨论/学习群,群内可以`提问答疑`,`分享学习资料`或者随便扯淡
|
||||
|
||||
<img src="https://raw.githubusercontent.com/FairyEver/d2-admin/master/github/join@2x.png"/>
|
||||
|
||||
## 获取代码
|
||||
|
||||
有两种方式可以获得 D2Admin 的代码
|
||||
|
||||
* 在 [releases](https://github.com/d2-projects/d2-admin/releases) 页面下载最新的发行版。发行版一般是完成了某个大升级或者修复重要 bug 后发布的压缩包,你可以下载下来直接使用
|
||||
|
||||
* Fork 仓库到你的 github 然后克隆到本地,然后使用 master 分支继续你的开发。这种方式得到的是最新的代码,但是会有未完成的新功能。**不建议使用这种方式**
|
||||
|
||||
* 由于 github 访问较慢,推荐前往码云仓库下载 [gitee.com/fairyever/d2-admin](https://gitee.com/fairyever/d2-admin),码云上的仓库**在每次发布版本才会更新**,所以如果你选择此方法,请直接 fork 仓库并克隆到本地
|
||||
|
||||
> 码云的仓库由 github 同步,但是发行版和标签同步有一些问题,所以推荐直接 fork 仓库
|
||||
|
||||
## 觉得不错 赏个咖啡 让作者打起精神 ~
|
||||
|
||||
<img src="https://raw.githubusercontent.com/FairyEver/d2-admin/master/github/reward-me@2x.png"/>
|
||||
<img src="https://raw.githubusercontent.com/FairyEver/d2-admin/master/github/qr@2x.png"/>
|
||||
|
||||
更多介绍和使用方法见 [文档](http://d2admin.fairyever.com/zh/)
|
||||
|
||||
## 朋友的开源项目
|
||||
|
||||
* [avue](https://github.com/nmxiaowei/avue)
|
||||
|
||||
<img src="https://raw.githubusercontent.com/FairyEver/d2-admin/master/github/give-a-star@2x.png"/>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
'use strict'
|
||||
// 检查依赖版本
|
||||
require('./check-versions')()
|
||||
|
||||
// 设置 NODE_ENV
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
// loading模块 https://www.npmjs.com/package/ora
|
||||
const ora = require('ora')
|
||||
// 删除模块 https://www.npmjs.com/package/rimraf
|
||||
const rm = require('rimraf')
|
||||
// path
|
||||
const path = require('path')
|
||||
// 输出彩色的文字 https://www.npmjs.com/package/chalk
|
||||
const chalk = require('chalk')
|
||||
// webpack
|
||||
const webpack = require('webpack')
|
||||
// 设置 这个文件里只用到了 config.build
|
||||
const config = require('../config')
|
||||
// webpack 生产环境的核心配置文件
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
// 定义一个 loading 并开始
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // if you are using ts-loader, setting this to true will make tyescript errors show up during build
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.log(chalk.red(' Build failed with errors.\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(' Build complete.\n'))
|
||||
console.log(chalk.yellow(
|
||||
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||
' Opening index.html over file:// won\'t work.\n'
|
||||
))
|
||||
})
|
||||
})
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
'use strict'
|
||||
const chalk = require('chalk')
|
||||
const semver = require('semver')
|
||||
const packageConfig = require('../package.json')
|
||||
const shell = require('shelljs')
|
||||
|
||||
function exec (cmd) {
|
||||
return require('child_process').execSync(cmd).toString().trim()
|
||||
}
|
||||
|
||||
const versionRequirements = [
|
||||
{
|
||||
name: 'node',
|
||||
currentVersion: semver.clean(process.version),
|
||||
versionRequirement: packageConfig.engines.node
|
||||
}
|
||||
]
|
||||
|
||||
if (shell.which('npm')) {
|
||||
versionRequirements.push({
|
||||
name: 'npm',
|
||||
currentVersion: exec('npm --version'),
|
||||
versionRequirement: packageConfig.engines.npm
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
const warnings = []
|
||||
|
||||
for (let i = 0; i < versionRequirements.length; i++) {
|
||||
const mod = versionRequirements[i]
|
||||
|
||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||
warnings.push(mod.name + ': ' +
|
||||
chalk.red(mod.currentVersion) + ' should be ' +
|
||||
chalk.green(mod.versionRequirement)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.length) {
|
||||
console.log('')
|
||||
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||
console.log()
|
||||
|
||||
for (let i = 0; i < warnings.length; i++) {
|
||||
const warning = warnings[i]
|
||||
console.log(' ' + warning)
|
||||
}
|
||||
|
||||
console.log()
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
101
build/utils.js
|
|
@ -1,101 +0,0 @@
|
|||
'use strict'
|
||||
const path = require('path')
|
||||
const config = require('../config')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const packageConfig = require('../package.json')
|
||||
|
||||
exports.assetsPath = function (_path) {
|
||||
const assetsSubDirectory = process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsSubDirectory
|
||||
: config.dev.assetsSubDirectory
|
||||
|
||||
return path.posix.join(assetsSubDirectory, _path)
|
||||
}
|
||||
|
||||
exports.cssLoaders = function (options) {
|
||||
options = options || {}
|
||||
|
||||
const cssLoader = {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
const postcssLoader = {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
// generate loader string to be used with extract text plugin
|
||||
function generateLoaders (loader, loaderOptions) {
|
||||
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||
|
||||
if (loader) {
|
||||
loaders.push({
|
||||
loader: loader + '-loader',
|
||||
options: Object.assign({}, loaderOptions, {
|
||||
sourceMap: options.sourceMap
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Extract CSS when that option is specified
|
||||
// (which is the case during production build)
|
||||
if (options.extract) {
|
||||
return ExtractTextPlugin.extract({
|
||||
use: loaders,
|
||||
fallback: 'vue-style-loader'
|
||||
})
|
||||
} else {
|
||||
return ['vue-style-loader'].concat(loaders)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||
return {
|
||||
css: generateLoaders(),
|
||||
postcss: generateLoaders(),
|
||||
less: generateLoaders('less'),
|
||||
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||
scss: generateLoaders('sass'),
|
||||
stylus: generateLoaders('stylus'),
|
||||
styl: generateLoaders('stylus')
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
exports.styleLoaders = function (options) {
|
||||
const output = []
|
||||
const loaders = exports.cssLoaders(options)
|
||||
|
||||
for (const extension in loaders) {
|
||||
const loader = loaders[extension]
|
||||
output.push({
|
||||
test: new RegExp('\\.' + extension + '$'),
|
||||
use: loader
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.createNotifierCallback = () => {
|
||||
const notifier = require('node-notifier')
|
||||
|
||||
return (severity, errors) => {
|
||||
if (severity !== 'error') return
|
||||
|
||||
const error = errors[0]
|
||||
const filename = error.file && error.file.split('!').pop()
|
||||
|
||||
notifier.notify({
|
||||
title: packageConfig.name,
|
||||
message: severity + ': ' + error.name,
|
||||
subtitle: filename || '',
|
||||
icon: path.join(__dirname, 'logo.png')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const sourceMapEnabled = isProduction
|
||||
? config.build.productionSourceMap
|
||||
: config.dev.cssSourceMap
|
||||
|
||||
module.exports = {
|
||||
loaders: {
|
||||
...utils.cssLoaders({
|
||||
sourceMap: sourceMapEnabled,
|
||||
extract: isProduction
|
||||
}),
|
||||
i18n: '@kazupon/vue-i18n-loader'
|
||||
},
|
||||
cssSourceMap: sourceMapEnabled,
|
||||
cacheBusting: config.dev.cacheBusting,
|
||||
transformToRequire: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
const createLintingRule = () => ({
|
||||
test: /\.(js|vue)$/,
|
||||
loader: 'eslint-loader',
|
||||
enforce: 'pre',
|
||||
include: [resolve('src'), resolve('test')],
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter'),
|
||||
emitWarning: !config.dev.showEslintErrorsInOverlay
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: ['babel-polyfill', './src/main.js']
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
publicPath: process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsPublicPath
|
||||
: config.dev.assetsPublicPath
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js',
|
||||
'@': resolve('src'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: [resolve('src'), resolve('test')]
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
loader: 'svg-sprite-loader',
|
||||
include: [resolve('src/assets/icons/svg')],
|
||||
options: {
|
||||
symbolId: 'd2-[name]'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
exclude: [resolve('src/assets/icons/svg')],
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
loaders: ["style", "css", "sass"]
|
||||
},
|
||||
{
|
||||
test: /\.less$/,
|
||||
loaders: ["style", "css", "less"]
|
||||
},
|
||||
{
|
||||
test: /\.md$/,
|
||||
loaders: ["text-loader"]
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
node: {
|
||||
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
// source contains it (although only uses it if it's native).
|
||||
setImmediate: false,
|
||||
// prevent webpack from injecting mocks to Node native modules
|
||||
// that does not make sense for the client
|
||||
dgram: 'empty',
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
child_process: 'empty'
|
||||
}
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
const portfinder = require('portfinder')
|
||||
|
||||
const HOST = process.env.HOST
|
||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
historyApiFallback: true,
|
||||
hot: true,
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
overlay: config.dev.errorOverlay
|
||||
? { warnings: false, errors: true }
|
||||
: false,
|
||||
publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
watchOptions: {
|
||||
poll: config.dev.poll,
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env')
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true
|
||||
}),
|
||||
]
|
||||
})
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
},
|
||||
onErrors: config.dev.notifyOnErrors
|
||||
? utils.createNotifierCallback()
|
||||
: undefined
|
||||
}))
|
||||
|
||||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
@ -1,145 +0,0 @@
|
|||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
const env = require('../config/prod.env')
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
|
||||
},
|
||||
plugins: [
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
parallel: true
|
||||
}),
|
||||
// extract css into its own file
|
||||
new ExtractTextPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||
allChunks: true,
|
||||
}),
|
||||
// Compress extracted CSS. We are using this plugin so that possible
|
||||
// duplicated CSS from different components can be deduped.
|
||||
new OptimizeCSSPlugin({
|
||||
cssProcessorOptions: config.build.productionSourceMap
|
||||
? { safe: true, map: { inline: false } }
|
||||
: { safe: true }
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: config.build.index,
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency'
|
||||
}),
|
||||
// keep module.id stable when vender modules does not change
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
// enable scope hoisting
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
// split vendor js into its own file
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks (module) {
|
||||
// any required modules inside node_modules are extracted to vendor
|
||||
return (
|
||||
module.resource &&
|
||||
/\.js$/.test(module.resource) &&
|
||||
module.resource.indexOf(
|
||||
path.join(__dirname, '../node_modules')
|
||||
) === 0
|
||||
)
|
||||
}
|
||||
}),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'manifest',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app',
|
||||
async: 'vendor-async',
|
||||
children: true,
|
||||
minChunks: 3
|
||||
}),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const prodEnv = require('./prod.env')
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"'
|
||||
})
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
'use strict'
|
||||
// Template version: 1.2.7
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
|
||||
// Paths
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: true,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
// Use Eslint Loader?
|
||||
// If true, your code will be linted during bundling and
|
||||
// linting errors and warnings will be shown in the console.
|
||||
useEslint: true,
|
||||
// If true, eslint errors and warnings will also be shown in the error overlay
|
||||
// in the browser.
|
||||
showEslintErrorsInOverlay: false,
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
devtool: 'eval-source-map',
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
// CSS Sourcemaps off by default because relative paths are "buggy"
|
||||
// with this option, according to the CSS-Loader README
|
||||
// (https://github.com/webpack/css-loader#sourcemaps)
|
||||
// In our experience, they generally work as expected,
|
||||
// just be aware of this issue when enabling this option.
|
||||
cssSourceMap: false,
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, '../dist/index.html'),
|
||||
|
||||
// Paths
|
||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||
assetsSubDirectory: 'static',
|
||||
// 请根据你的站点地址修改这里
|
||||
assetsPublicPath: '/d2-admin-preview/',
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: true,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: '#source-map',
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# 确保脚本抛出遇到的错误
|
||||
set -e
|
||||
|
||||
# 生成静态文件
|
||||
npm run doc:build
|
||||
|
||||
# 进入生成的文件夹
|
||||
cd docs/.vuepress/dist
|
||||
|
||||
git init
|
||||
git add -A
|
||||
git commit -m 'deploy'
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io
|
||||
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io/<REPO>
|
||||
# git push -f git@github.com:FairyEver/d2-admin.git master:gh-pages
|
||||
git push -f git@gitee.com:fairyever/d2-admin-doc.git master
|
||||
|
||||
cd -
|
||||
|
||||
echo "publish to http://d2admin.fairyever.com/zh/"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
set -e
|
||||
|
||||
git add --all
|
||||
|
||||
git commit -m 'no message'
|
||||
|
||||
git push
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# 确保脚本抛出遇到的错误
|
||||
set -e
|
||||
|
||||
# 生成静态文件
|
||||
npm run build
|
||||
|
||||
# 进入生成的文件夹
|
||||
cd dist
|
||||
|
||||
# 如果是发布到自定义域名
|
||||
# echo 'www.example.com' > CNAME
|
||||
|
||||
git init
|
||||
git add -A
|
||||
git commit -m 'deploy'
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io
|
||||
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io/<REPO>
|
||||
git push -f git@gitee.com:fairyever/d2-admin-preview.git master
|
||||
|
||||
cd -
|
||||
|
||||
echo "publish to https://fairyever.gitee.io/d2-admin-preview/#/index"
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
module.exports = {
|
||||
locales: {
|
||||
'/': {
|
||||
lang: 'en-US',
|
||||
title: 'D2 Admin',
|
||||
description: 'Elegant management system front-end integration'
|
||||
},
|
||||
'/zh/': {
|
||||
lang: 'zh-CN',
|
||||
title: 'D2 Admin',
|
||||
description: '优雅的管理系统前端集成方案'
|
||||
}
|
||||
},
|
||||
head: [
|
||||
['link', { rel: 'icon', href: `/logo@2x.png` }],
|
||||
['script', {}, 'var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "https://hm.baidu.com/hm.js?be9d34853430c136b5d62c3081d556a5";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();']
|
||||
],
|
||||
themeConfig: {
|
||||
// 项目仓库地址
|
||||
repo: 'https://github.com/d2-projects/d2-admin',
|
||||
// 自定义仓库链接文字
|
||||
repoLabel: '查看源码',
|
||||
// 文档不是放在仓库的根目录下
|
||||
docsDir: 'docs',
|
||||
// 默认是 false, 设置为 true 来启用
|
||||
editLinks: true,
|
||||
// 多国语言
|
||||
locales: {
|
||||
'/': {
|
||||
selectText: 'Languages',
|
||||
label: 'English',
|
||||
editLinkText: 'Edit this page on GitHub',
|
||||
lastUpdated: 'Last update',
|
||||
nav: [
|
||||
{ text: 'preview', link: 'https://fairyever.gitee.io/d2-admin-preview/#/index' }
|
||||
]
|
||||
},
|
||||
'/zh/': {
|
||||
selectText: '选择语言',
|
||||
label: '简体中文',
|
||||
editLinkText: '在 GitHub 上编辑此页',
|
||||
lastUpdated: '最后更新',
|
||||
nav: [
|
||||
{ text: '指南', link: '/zh/guide/' },
|
||||
{ text: '插件', link: '/zh/plugins/' },
|
||||
{ text: '组件', link: '/zh/components/' },
|
||||
{ text: '文章', link: '/zh/article/' },
|
||||
{ text: '其它', link: '/zh/others/' },
|
||||
{ text: '预览', link: 'https://fairyever.gitee.io/d2-admin-preview/#/index' }
|
||||
],
|
||||
sidebar: {
|
||||
'/zh/guide/': sideBarGuide('指南'),
|
||||
'/zh/plugins/': sideBarPlugins('插件'),
|
||||
'/zh/components/': sideBarComponents('组件'),
|
||||
'/zh/article/': sideBarArticle('版本更新'),
|
||||
'/zh/others/': sideBarOthers('其它')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sideBarGuide (title) {
|
||||
return [
|
||||
{
|
||||
title,
|
||||
collapsable: false,
|
||||
children: [
|
||||
'',
|
||||
'question',
|
||||
'pr',
|
||||
'change-log'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
function sideBarPlugins () {
|
||||
return [
|
||||
'',
|
||||
'data-export',
|
||||
'data-import',
|
||||
'i18n',
|
||||
'mock'
|
||||
]
|
||||
}
|
||||
|
||||
function sideBarComponents (title) {
|
||||
return [
|
||||
{
|
||||
title,
|
||||
collapsable: false,
|
||||
children: [
|
||||
'',
|
||||
'charts',
|
||||
'charts-new',
|
||||
'container',
|
||||
'count-up',
|
||||
'highlight',
|
||||
'icon-select',
|
||||
'icon-svg',
|
||||
'icon',
|
||||
'markdown'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
function sideBarArticle (titleUpdate) {
|
||||
return [
|
||||
{
|
||||
title: titleUpdate,
|
||||
collapsable: false,
|
||||
children: [
|
||||
'',
|
||||
'update/1.1.4',
|
||||
'update/0.0.0'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
function sideBarOthers (title) {
|
||||
return [
|
||||
{
|
||||
title,
|
||||
collapsable: false,
|
||||
children: [
|
||||
'',
|
||||
'css'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
$accentColor = #409EFF
|
||||
|
|
@ -1 +0,0 @@
|
|||
d9ade30cf874de657275755e4783fde51f2f6ffc
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
---
|
||||
home: true
|
||||
heroImage: /logo@2x.png
|
||||
actionText: Get Started →
|
||||
actionLink: /zh/guide/
|
||||
features:
|
||||
- title: Vue-Powered
|
||||
details: Enjoy the dev experience of Vue + webpack, Ultra fast virtual DOM and the most economical optimization.
|
||||
- title: Rich integration
|
||||
details: The plug-ins and components that are likely to be used are ready for you. Some come from third parties, others are designed for d2admin.
|
||||
- title: ElementUI component library
|
||||
details: Integrated and robust ElementUI, and use any ElementUI component at will.
|
||||
footer: MIT Licensed | Copyright © 2018-present FairyEver
|
||||
---
|
||||
|
||||
**The English document will be launched in the future. Please move to the Chinese document.**
|
||||
|
||||
**英文文档会在中文文档大致完成后推出,现请移步中文文档**
|
||||
|
||||
```
|
||||
// install package
|
||||
npm i
|
||||
// run
|
||||
npm run dev
|
||||
// build
|
||||
npm run build
|
||||
```
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
---
|
||||
home: true
|
||||
heroImage: /logo@2x.png
|
||||
actionText: 快速上手 →
|
||||
actionLink: /zh/guide/
|
||||
features:
|
||||
- title: Vue驱动
|
||||
details: 享受 Vue + webpack 的开发体验,超快虚拟 DOM 和最省心的优化。
|
||||
- title: 丰富集成
|
||||
details: 已经为你准备好了很可能用到的插件和组件,有的来自第三方,有的专为 d2admin 设计。
|
||||
- title: ElementUI组件库
|
||||
details: 集成完善且强大的 ElementUI,随意搭配使用任何 ElementUI 组件。
|
||||
footer: MIT Licensed | Copyright © 2018-present FairyEver
|
||||
---
|
||||
|
||||
```
|
||||
// 安装依赖
|
||||
npm i
|
||||
|
||||
// 运行
|
||||
npm run dev
|
||||
|
||||
// 打包
|
||||
npm run build
|
||||
```
|
||||
|
||||
> 如果上述步骤出现错误,建议您升级 node 版本 > 8,如果有其它疑问请参考[常见问题](/zh/guide/question.html)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# 章节介绍
|
||||
|
||||
这个章节下收录关于 D2Admin 的一些介绍,用法,以及每次发布新版本时的推广文章,也是每篇新文章的首发地址。
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
# 公布项目
|
||||
|
||||

|
||||
|
||||
# 介绍
|
||||
|
||||
D2Admin 是一个开源的管理系统前端集成方案
|
||||
|
||||
[Github仓库](https://github.com/d2-projects/d2-admin) - [预览地址](https://fairyever.gitee.io/d2-admin-preview/#/index) - [中文文档](https://fairyever.gitee.io/d2-admin-doc/zh/)
|
||||
|
||||
D2Admin 是完全开源免费的管理系统集成方案,由 [FairyEver](https://github.com/FairyEver) 在工作之余完全由兴趣驱动完成,如果你也一样喜欢前端开发,欢迎加入我们的讨论/学习群,群内可以`提问答疑`,`分享学习资料`或者随便扯淡
|
||||
|
||||
**QQ群**
|
||||
|
||||
群号 806395827 欢迎大家
|
||||
|
||||
**微信群**
|
||||
|
||||
作者微信 liyang1711467488
|
||||
|
||||
> 微信群需要先加群主才可以拉进群
|
||||
|
||||
## 功能
|
||||
|
||||
* 首屏加载等待动画 避免首次加载白屏尴尬
|
||||
* 简约主题
|
||||
* 每个插件和组件都配有介绍文档
|
||||
* 图片资源 sketch 源文件( 可以在这个文件内重新生成所有图片资源 )
|
||||
* 登陆和注销
|
||||
* 根据路由自动生成菜单
|
||||
* 可折叠侧边栏
|
||||
* 方便的菜单设置
|
||||
* 多国语言支持
|
||||
* 富文本编辑器
|
||||
* Markdown 编辑器
|
||||
* 全屏功能
|
||||
* Fontawesome 图标库
|
||||
* 图标选择器(组件)
|
||||
* 自动引入下载的 SVG 图标
|
||||
* 前端假数据支持( mock )
|
||||
* 集成蚂蚁金服出品的 G2 图表
|
||||
* 图表自适应可拖拽大小的卡片容器(示例)
|
||||
* 简化剪贴板操作
|
||||
* 简化Cookie操作
|
||||
* 时间日期计算工具
|
||||
* 导入 Excel ( xlsx 格式 + csv 格式 )
|
||||
* 数据导出 Excel ( xlsx 格式 + csv 格式 )
|
||||
* 数据导出文本
|
||||
* 数字动画
|
||||
* 可拖拽调整大小的切分布局
|
||||
* 可拖拽调整大小和位置的网格布局
|
||||
* 提供三种方便的页面容器组件(正常卡片,隐形容器,填满页面)
|
||||
* 代码高亮显示
|
||||
* 加载并解析(或者直接指定资源) markdown 文件
|
||||
* GitHub 样式的 markdown 显示组件
|
||||
* markdown 内代码高亮
|
||||
* 为 markdown 扩展了百度云链接解析和优化显示
|
||||
* 右键菜单组件
|
||||
* 自定义滚动条和滚动控制
|
||||
* 内置4种主题
|
||||
* 公用样式抽离,方便的主题定制
|
||||
* 支持百万级数据量的表格组件
|
||||
* 打包后随意目录部署(已经做好兼容设置)
|
||||
|
||||
## TODO
|
||||
|
||||
D2Admin 仍然处于开发中,这里有一些计划:
|
||||
|
||||
* 分离出简化版本
|
||||
* 推出基于 [ice](https://alibaba.github.io/ice) 平台的版本
|
||||
* 增加右上角通知中心
|
||||
* 增加一些实例页面以提供业务页面布局建议
|
||||
* 更换图表库
|
||||
* 多 tab 页结构
|
||||
* 面包屑导航
|
||||
* 树型表格组件
|
||||
* `1.1.0 完成` 抽离项目里的文档,集中存放在文档站点
|
||||
* `1.1.0 完成` 对主界面进行一次完善,调整整体布局和颜色
|
||||
* `1.1.0 完成` 切换主题功能
|
||||
|
||||
欢迎你为 D2Admin 的开发作出贡献(代码编写/文档翻译)。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
├─ build
|
||||
├─ config
|
||||
├─ docs // 文档
|
||||
├─ src
|
||||
│ ├─ assets // 资源
|
||||
│ │ ├─ icons
|
||||
│ │ ├─ image
|
||||
│ │ ├─ library
|
||||
│ │ └─ style
|
||||
│ ├─ components // 组件
|
||||
│ │ ├─ charts
|
||||
│ │ ├─ core
|
||||
│ │ └─ demo
|
||||
│ ├─ i18n // 多国语
|
||||
│ ├─ menu // 菜单
|
||||
│ ├─ mock // 模拟数据
|
||||
│ ├─ pages // 页面
|
||||
│ ├─ plugin // 插件
|
||||
│ ├─ router // 路由
|
||||
│ ├─ store // vuex
|
||||
│ ├─ utils
|
||||
│ ├─ App.vue
|
||||
│ └─ main.js
|
||||
├─ static // 静态资源
|
||||
├─ .babelrc
|
||||
├─ .editorconfig
|
||||
├─ .eslintignore
|
||||
├─ .eslintrc.js
|
||||
├─ .gitattributes
|
||||
├─ .gitignore
|
||||
├─ .postcssrc.js
|
||||
├─ LICENSE
|
||||
├─ README.md
|
||||
├─ deploy.sh
|
||||
├─ design.sketch // 设计文件
|
||||
├─ index.html
|
||||
└─ package.json
|
||||
```
|
||||
|
|
@ -1,218 +0,0 @@
|
|||
# 版本发布 1.1.4
|
||||
|
||||

|
||||
|
||||
D2Admin 是一个 **注重外观表现** 的管理系统 **PC端** 集成方案,现在正在紧张开发维护。
|
||||
|
||||
## 前言
|
||||
|
||||
距离 D2Admin 正式和大家见面(开源),已经过去一个多月了。
|
||||
|
||||

|
||||
|
||||
现在想想这一个月真是很忙碌,几乎所有的业余时间都用在了开源项目上,公司没事的时候在写,晚上回家每天都要写到一点左右,回家火车上都在忙着改代码...
|
||||
|
||||

|
||||
|
||||
上图:好友不幸骨折,守着他编码...(希望他早点康复)
|
||||
|
||||
有天我和朋友说,感觉真是开源个项目,把自己整个人都开源了,一个人又要设计又要写代码又要写文档还要回答问题,除了上班吃睡就都是它了!
|
||||
|
||||
但是就我个人而言,我感觉倒也是一种不错的体验。
|
||||
|
||||
通过这个开源产品,认识了很多朋友,有了自己的小交流群,平日没事了大家一起讨论讨论问题也挺不错。当然也新认识了一些大佬(膜拜),通过交流也有不小的收获。
|
||||
|
||||
## 介绍
|
||||
|
||||
废话不多说了,一介码农也没有什么文采,今天也是趁着发版的机会小发表一些想法,下面就介绍一下这一个月来究竟升级了什么吧,先放几张截图吧:
|
||||
|
||||
### 预览
|
||||
|
||||
经典主题:
|
||||
|
||||

|
||||
|
||||
集成组件和插件:
|
||||
|
||||

|
||||
|
||||
图标选择器:
|
||||
|
||||

|
||||
|
||||
版本检查:
|
||||
|
||||

|
||||
|
||||
灰度模式:
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
数据持久化:
|
||||
|
||||

|
||||
|
||||
图表:
|
||||
|
||||

|
||||
|
||||
主题:
|
||||
|
||||

|
||||
|
||||
响应大家需求,这次最大的升级:多标签页:
|
||||
|
||||

|
||||
|
||||
上面是我随便截了几张图片 如果你感兴趣的话可以去体验地址一趟 -> [体验地址](https://fairyever.gitee.io/d2-admin-preview/#/index) <-。
|
||||
|
||||
项目现在集成了不少的库和插件,第一次加载确实有些慢,以后有空了优化一下。
|
||||
|
||||
另外大家实际使用的时候建议使用 [简化版模板](https://github.com/d2-projects/d2-admin-start-kit)。
|
||||
|
||||
### 完整功能列表
|
||||
|
||||
* 首屏加载等待动画 避免首次加载白屏尴尬
|
||||
* 简约主题
|
||||
* 每个插件和组件都配有介绍文档
|
||||
* 图片资源 sketch 源文件( 可以在这个文件内重新生成所有图片资源 )
|
||||
* 登陆和注销
|
||||
* 根据路由自动生成菜单
|
||||
* 可折叠侧边栏
|
||||
* 方便的菜单设置
|
||||
* 多国语言支持
|
||||
* 富文本编辑器
|
||||
* Markdown 编辑器
|
||||
* 全屏功能
|
||||
* Fontawesome 图标库
|
||||
* 图标选择器(组件)
|
||||
* 自动引入下载的 SVG 图标
|
||||
* 前端假数据支持( mock )
|
||||
* 集成蚂蚁金服出品的 G2 图表
|
||||
* 图表自适应可拖拽大小的卡片容器(示例)
|
||||
* 简化剪贴板操作
|
||||
* 简化Cookie操作
|
||||
* 时间日期计算工具
|
||||
* 导入 Excel ( xlsx 格式 + csv 格式 )
|
||||
* 数据导出 Excel ( xlsx 格式 + csv 格式 )
|
||||
* 数据导出文本
|
||||
* 数字动画
|
||||
* 可拖拽调整大小的切分布局
|
||||
* 可拖拽调整大小和位置的网格布局
|
||||
* 提供三种方便的页面容器组件(正常卡片,隐形容器,填满页面)
|
||||
* 代码高亮显示
|
||||
* 加载并解析(或者直接指定资源) markdown 文件
|
||||
* GitHub 样式的 markdown 显示组件
|
||||
* markdown 内代码高亮
|
||||
* 为 markdown 扩展了百度云链接解析和优化显示
|
||||
* 右键菜单组件
|
||||
* 自定义滚动条和滚动控制
|
||||
* 内置5种主题
|
||||
* 公用样式抽离,方便的主题定制
|
||||
* 支持百万级数据量的表格组件
|
||||
* 打包后随意目录部署(已经做好兼容设置)
|
||||
* 支持临时菜单配置
|
||||
* 提供“试验台”功能 方便展示系统功能调用方法 `1.1.4 +`
|
||||
* 多标签页模式 `1.1.4 +`
|
||||
* 美化滚动条 `1.1.4 +`
|
||||
* 持久化存储 `1.1.4 +`
|
||||
|
||||
### 更新列表
|
||||
|
||||
这个列表在这里也可以查看 -> [中文文档 | 更新日志](https://fairyever.gitee.io/d2-admin-doc/zh/guide/change-log.html#v1-1-0)
|
||||
|
||||
#### 1.1.4
|
||||
|
||||
* [ 修改 ] 全局状态管理设计优化
|
||||
* [ 修改 ] 主题调优
|
||||
* [ 新增 ] playground 模块,方便测试和展示一些功能实现方式/调用方法
|
||||
* [ 新增 ] 灰度模式
|
||||
* [ 新增 ] 多页模式
|
||||
* [ 新增 ] 多页模式缓存
|
||||
* [ 新增 ] 多页模式快速关闭(关闭左侧 右侧 全部 其它)
|
||||
* [ 修改 ] 侧边栏滚动优化
|
||||
* [ 新增 ] `d2-container` 填充模式自定义滚动条
|
||||
* [ 新增 ] `d2-container` 组件卡片和隐形模式自定义滚动条
|
||||
* [ 新增 ] 现在页面标题可以根据路由做出对应变化了
|
||||
* [ 新增 ] 版本检查机制
|
||||
* [ 新增 ] `d2-container` 隐形模式支持 header 插槽
|
||||
* [ 新增 ] 版本检查可以设置为不显示提示框
|
||||
* [ 新增 ] 集成 json 查看组件
|
||||
* [ 新增 ] 添加了所有图表种类的演示页面
|
||||
* [ 修改 ] 修改布局方式,解决了在 Firefox 上 better-scroll 初始化拿不到正确高度的 bug
|
||||
* [ 新增 ] 右上角显示用户名,用户名持久存储
|
||||
|
||||
#### 1.1.3
|
||||
|
||||
* [ 修复 ] 侧边栏在折叠时不显示的 bug
|
||||
* [ 新增 ] v-charts 插件
|
||||
* [ 新增 ] 一些演示图表(后续打算把 v-charts 文档上有示例性的演示都展示一下)
|
||||
* [ 修改 ] D2Admin 经典主题颜色调整
|
||||
* [ 新增 ] violet 主题
|
||||
* [ 新增 ] 菜单图标
|
||||
* [ 修改 ] 新制作了 Fork me 图片
|
||||
|
||||
#### 1.1.2
|
||||
|
||||
* [ 修改 ] 删除了 G2 相关的依赖
|
||||
|
||||
#### 1.1.1
|
||||
|
||||
* [ 修改 ] 删除了 G2 相关的代码(移除图表库)
|
||||
* [ 优化 ] 侧边栏取值逻辑
|
||||
|
||||
#### 1.1.0
|
||||
|
||||
* [ 修改 ] 顶栏和侧边栏菜单新的结构生成方式,新的方案使用 数据 + 递归组件 实现无限制多级菜单
|
||||
* [ 修改 ] 路由注册回归最简单的写法
|
||||
* [ 修复 ] 首次加载 loading 样式类名和程序内类名冲突,新的加载类名使用 d2-app-loading 前缀
|
||||
* [ 修改 ] 所有类似 dd- 的样式前缀(包括自动注册图标的id前缀)统一改为 d2-
|
||||
* [ 修复 ] 修复 d2-highlight 组件和 d2-markdown 组件的样式冲突
|
||||
* [ 修改 ] 内置组件名称统一改为 d2- 前缀,统一使用横线连接 (kebab-case) 风格
|
||||
* [ 修改 ] 顶栏 logo 阴影删除
|
||||
* [ 新增 ] 主题系统
|
||||
* [ 新增 ] 三个主题,分别为 d2admin 经典,简约线条,流星
|
||||
* [ 修改 ] d2-markdown 组件 md 参数改名为 source
|
||||
* [ 修改 ] 删除了 d2-markdown 组件中图片的白色背景
|
||||
* [ 修改 ] 删除 timeago 插件,更换为更强大的 dayjs
|
||||
* [ 新增 ] Tomorrow Night Blue 主题
|
||||
* [ 修改 ] src/assets/style/public-class.scss 写法优化
|
||||
* [ 新增 ] [vue-bigdata-table](https://github.com/lison16/vue-bigdata-table)组件
|
||||
* [ 修复 ] 侧边栏内容超过一屏后显示错误
|
||||
* [ 新增 ] 自定义滚动条演示页面
|
||||
* [ 新增 ] 流星主题新增背景图片上层的半透明遮罩
|
||||
* [ 修复 ] 主题设置失效bug
|
||||
* [ 修复 ] router守卫验证登陆部分代码修改
|
||||
* [ 修复 ] d2-container 组件改为同步注册(之前的异步注册会有 mounted 生命周期问题,即 slot 内的页面在 mounted 生命周期内拿不到 dom)
|
||||
* [ 修复 ] d2-container 组件重构 flex 布局
|
||||
* [ 新增 ] 404 page
|
||||
* [ 新增 ] 顶栏联系方式
|
||||
* [ 新增 ] 右键菜单组件
|
||||
* [ 新增 ] 菜单配置支持空菜单(项目开发的时候有可能需要先把菜单做好查看效果)
|
||||
* [ 优化 ] 页面左侧菜单滚动条优化
|
||||
* [ 修复 ] CSS 边距工具类都加上了 `!important` 来保证在覆盖样式时生效
|
||||
* [ 修复 ] IE11 兼容性修复
|
||||
|
||||
写这篇文章的时候心情竟然出奇地平静,终于发新版了,总算松了一口气...
|
||||
|
||||
### 下阶段的计划:
|
||||
|
||||
* ice 版本
|
||||
* bug 修复
|
||||
|
||||
## 项目地址
|
||||
|
||||
| 地址 | 描述 |
|
||||
| --- | --- |
|
||||
| [团队主页](https://github.com/d2-projects) | D2Admin 所属的团队主页 |
|
||||
| [中文文档](http://d2admin.fairyever.com/zh/) | 中文文档 |
|
||||
| [预览地址](https://fairyever.gitee.io/d2-admin-preview/#/index) | 预览地址 |
|
||||
| [github](https://github.com/d2-projects/d2-admin) | Github 仓库 |
|
||||
| [码云](https://gitee.com/fairyever/d2-admin) | 码云镜像仓库 |
|
||||
| [简化版 github](https://github.com/d2-projects/d2-admin-start-kit) | 简化版 Github 仓库 |
|
||||
| [简化版 码云](https://gitee.com/fairyever/d2-admin-start-kit) | 简化版码云镜像仓库 |
|
||||
|
||||
在最后,如果你看完了,并且觉得不错,希望可以到 [项目主页](https://github.com/d2-projects/d2-admin) 上点一个 **star** 作为你对这个项目的认可与支持,谢谢。
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# 组件概述
|
||||
|
||||
d2-admin(以下简称 d2admin)封装(或者集成第三方)了一些组件,方便开发者进行开发,具体组件文档请从左侧列表进入
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# 图表 [ v-charts ]
|
||||
|
||||
::: tip
|
||||
`1.1.0` 版本使用的是 `G2` 图表库,`1.1.3` 开始使用 `v-charts`
|
||||
:::
|
||||
|
||||
## 介绍
|
||||
|
||||
在使用 echarts 生成图表时,经常需要做繁琐的数据类型转化、修改复杂的配置项,v-charts 的出现正是为了解决这个痛点。基于 Vue2.0 和 echarts 封装的 v-charts 图表组件,只需要统一提供一种对前后端都友好的数据格式设置简单的配置项,便可轻松生成常见的图表。
|
||||
|
||||
[v-charts 文档](https://v-charts.js.org/#/)
|
||||
|
||||
处于对用户使用方便的角度考虑,从 `1.1.3` 开始使用 v-charts。项目中已经安装并注册完毕 v-charts,你可以直接使用
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
# 图表 [ G2 ]
|
||||
|
||||
::: tip
|
||||
此文档仅对 `1.1.0` 及其以下版本有效,`1.1.1` 开始变更了图表库
|
||||
:::
|
||||
|
||||
## 介绍
|
||||
|
||||
D2Admin 集成了由蚂蚁金服出品的 **G2** 图表库
|
||||
|
||||
## 实现方式
|
||||
|
||||
`src/components/charts/register.js` 为注册图表组件的文件
|
||||
|
||||
`src/components/charts/G2` 为图表组件存放位置
|
||||
|
||||
`src/components/charts/G2/mixins/G2.js` 是图表最主要的文件,这是一个所有的图表组件都会使用的 mixin,这个 mixin 主要有以下用途
|
||||
|
||||
- 将 G2 和 DataSet 绑定到 data 上,方便组件使用,省去重复 `import G2 from '@antv/g2'` 等
|
||||
- 将 [G2 Chart类](http://antv.alipay.com/zh-cn/g2/3.x/api/chart.html#_Chart) 的属性全部暴露为 Vue 组件参数,这些参数会在初始化图表时用到
|
||||
- 提供了额外的设置参数,比如自动高度,自动初始化,初始化延时
|
||||
- 关闭 G2 的体验改进计划打点请求
|
||||
- data 上的 chart 对象
|
||||
- 自动初始化(或者不初始化)图表
|
||||
- `creatChart` 方法,根据参数设置生成 data 上的 chart 对象
|
||||
- `resize` 方法
|
||||
|
||||
在图表组件中使用这个 mixin 示例
|
||||
|
||||
``` vue
|
||||
<template>
|
||||
<!-- 如果需要开启自动高度功能 需要在这里设置 style="height: 100%;" -->
|
||||
<div ref="chart" style="height: 100%;"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 引入公用 mixin
|
||||
import G2 from '@/components/charts/G2/mixins/G2.js'
|
||||
export default {
|
||||
mixins: [
|
||||
G2
|
||||
],
|
||||
methods: {
|
||||
// 初始化图表
|
||||
init () {
|
||||
// mixin 中提供 creatChart 方法,这部分每个图表都一样
|
||||
this.creatChart()
|
||||
// 本组件的特殊设置 这部分每个图表不一样 你只需要改这部分内容
|
||||
this.chart.source(this.data)
|
||||
this.chart.coord().transpose()
|
||||
this.chart.interval().position('x*y')
|
||||
// 最后一步 渲染图表 这部分每个图表都一样
|
||||
this.chart.render()
|
||||
},
|
||||
// 数据源改变 重新渲染新的数据
|
||||
changeData () {
|
||||
this.chart.changeData(this.data)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
上面的代码段展示了如何使用 mixin 快速制作一个图表组件,只需根据某个图表的个性化需要,在组件中重新定义 `init` 和 `changeData` 方法即可
|
||||
|
||||
你可以修改这个 mixin 去实现更多的功能,同时影响所有的图表组件
|
||||
|
||||
::: tip
|
||||
这只仅仅是作者个人对于图表封装的一个实现思路
|
||||
:::
|
||||
|
||||
## 为什么没有选择其他产品
|
||||
|
||||
G2 完全可以胜任一般的后台界面报表图表需求,而且官网文档清晰友好
|
||||
|
||||
如果你需要更酷炫的图表,也完全可以剔除集成的库,换用 百度的[echarts](http://echarts.baidu.com/) 或者超级强大的 [d3.js](https://d3js.org/)
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
# 页面容器
|
||||
|
||||
页面容器组件是每个页面的基础,为了在整个项目中统一效果,它应该是 `<template>` 组件的直接子组件
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| type | 容器类型 | 非 | String | card ghost full | card |
|
||||
| scroll | 滚动优化 | 非 | Boolean | | false |
|
||||
| responsive | 响应式宽度 | 非 | Boolean | | false |
|
||||
|
||||
::: tip
|
||||
`responsive` 参数设置只在 `type` 等于 `card` 或 `ghost` 时生效
|
||||
:::
|
||||
|
||||
## 使用方法
|
||||
|
||||
一个基础单文件页面组件的示例
|
||||
|
||||
``` vue
|
||||
<template>
|
||||
<d2-container>
|
||||
<template slot="header">
|
||||
可选的 header 内容 ...
|
||||
</template>
|
||||
主体内容 ...
|
||||
</d2-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'your-component-name'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 需要的话引入
|
||||
@import '~@/assets/style/public.scss';
|
||||
</style>
|
||||
```
|
||||
|
||||
### 基础页面容器
|
||||
|
||||
高度根据内容适应
|
||||
|
||||
``` vue
|
||||
<d2-container>
|
||||
主体内容
|
||||
</d2-container>
|
||||
```
|
||||
|
||||
使用 `slot`
|
||||
|
||||
``` vue
|
||||
<d2-container>
|
||||
<template slot="header">我是插入到 header 中的内容</template>
|
||||
主体内容
|
||||
</d2-container>
|
||||
```
|
||||
|
||||
### 自适应填充页面容器
|
||||
|
||||
无论内容高度多少,都会自动撑满页面,并有可选的 `header` 和 `footer` 插槽
|
||||
|
||||
示例:
|
||||
|
||||
``` vue
|
||||
<template>
|
||||
<d2-container type="full">
|
||||
<template slot="header">
|
||||
可选的 header 内容 ...
|
||||
</template>
|
||||
主体内容 ...
|
||||
<template slot="footer">
|
||||
可选的 footer 内容 ...
|
||||
</template>
|
||||
</d2-container>
|
||||
</template>
|
||||
```
|
||||
|
||||
`v1.1.4` 新增
|
||||
|
||||
你可以通过设置 `scroll` 来启用自定义滚动条,看起来更美观一些
|
||||
|
||||
> 有些情况下使用滚动优化模式会有意外影响,例如页面内含有可拖拽的元素,这时候最好不要使用此模式
|
||||
|
||||
示例:
|
||||
|
||||
``` vue
|
||||
<template>
|
||||
<d2-container type="full" scroll>
|
||||
<template slot="header">
|
||||
可选的 header 内容 ...
|
||||
</template>
|
||||
主体内容 ...
|
||||
<template slot="footer">
|
||||
可选的 footer 内容 ...
|
||||
</template>
|
||||
</d2-container>
|
||||
</template>
|
||||
```
|
||||
|
||||
### 隐形页面容器
|
||||
|
||||
不显示任何背景色和边框,通常这个模式只有在极少情况下会使用
|
||||
|
||||
``` vue
|
||||
<d2-container type="ghost">
|
||||
主体内容
|
||||
</d2-container>
|
||||
```
|
||||
|
||||
如果你不希望内容紧贴上边,可以在内容外层容器设置 `class="d2-mt"`
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# 数字动画
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| start | 起始值 | 非 | Number | | 0 |
|
||||
| end | 结束值 | 是 | Number | | 0 |
|
||||
| decimals | 小数位数 | 非 | Number | | 0 |
|
||||
| duration | 持续时间 | 非 | Number | | 2 |
|
||||
| options | 设置项 | 非 | Object | | 空对象 |
|
||||
| callback | 回调函数 | 非 | Function | | 空函数 |
|
||||
|
||||
## 示例
|
||||
|
||||
``` vue
|
||||
// 基本使用方法
|
||||
<d2-count-up :end="100"/>
|
||||
|
||||
// 设置始末值
|
||||
<d2-count-up :start="14" :end="100"/>
|
||||
|
||||
// 设置动画时间
|
||||
<d2-count-up :end="100" :decimals="2"/>
|
||||
```
|
||||
|
||||
组件会在页面上渲染 `<span>` 标签
|
||||
|
||||
组件根据 [countUp.js](https://github.com/inorganik/countUp.js) 封装,`options` 参数详见原始插件文档
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# 代码高亮
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| code | 代码字符串 | 非 | String | | console.log('you lost code prop') |
|
||||
|
||||
## 示例
|
||||
|
||||
``` vue
|
||||
<d2-highlight code="alert('Hello')"/>
|
||||
```
|
||||
|
||||
::: tip
|
||||
本框架只是提供代码高亮的简单实现,如需实现更高级的设置请修改组件代码
|
||||
:::
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# 图标 - 选择器
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| value | 绑定的值,可以使用 v-model | 非 | String | | |
|
||||
| placeholder | 占位符,显示在未选择之前的按钮和输入框中 | 非 | String | | 请选择 |
|
||||
| placement | 界面探出方向 | 非 | String | 同 Popover 组件 placement 参数 | right |
|
||||
| clearable | 是否允许清空 | 非 | Boolean | | true |
|
||||
| userInput | 是否允许用户自由输入 | 非 | Boolean | | false |
|
||||
| autoClose | 是否在选择后自动关闭 | 非 | Boolean | | true |
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# 图标 - SVG
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| name | 图标名称 | 非 | String | src/assets/icons/svg 中 .svg 文件名 | 空 |
|
||||
|
||||
## 使用方法
|
||||
|
||||
首先将下载的 .svg 图标放入 `src/assets/icons/svg` 文件夹下
|
||||
|
||||
然后使用组件
|
||||
|
||||
``` vue
|
||||
<d2-icon-svg name="刚才的svg文件名"/>
|
||||
```
|
||||
|
||||
## 获取已经注册的所有图标
|
||||
|
||||
你已经发现了,只需要将图标文件放入项目中就会自动注册
|
||||
|
||||
这是因为已经对 `webpack` 和 `svg-sprite-loader` 进行了相关设置,`src/assets/icons/svg` 文件夹中的图标会自动注册到项目中,文件全部打包成 svg-sprite,名称注册到 `Vue.$IconSvg` 属性中
|
||||
|
||||
所以如果你需要检查项目中已经注册的所有图标,可以通过如下方式
|
||||
|
||||
``` vue
|
||||
// 在 vue 单文件组件中
|
||||
console.log(this.$IconSvg)
|
||||
```
|
||||
|
||||
## 参考
|
||||
|
||||
演示图标来源 [iconfont.cn @龙正昆《常用的50个4px双色图标库》](http://iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.d9df05512&cid=4878)
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# 图标
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| name | 图标名称 | 非 | String | font-awesome 所有图标名 | font-awesome |
|
||||
|
||||
## 使用方法
|
||||
|
||||
基本
|
||||
|
||||
``` vue
|
||||
// 这样用没有毛病 但是也没什么用
|
||||
<d2-icon/>
|
||||
|
||||
// 指定图标名称
|
||||
<d2-icon name="github"/>
|
||||
|
||||
// 设置行内样式
|
||||
<d2-icon name="github" style="font-size: 100px;"/>
|
||||
|
||||
// 设置 class
|
||||
<d2-icon name="github" class="icon-class-demo"/>
|
||||
```
|
||||
|
||||
这个组件只是简化了写法而已
|
||||
|
||||
``` vue
|
||||
<d2-icon name="github"/>
|
||||
// 等同于
|
||||
<i class="fa fa-github" aria-hidden="true"></i>
|
||||
```
|
||||
|
||||
## 参考
|
||||
|
||||
图标索引
|
||||
|
||||
[Font Awesome 中文网](http://www.fontawesome.com.cn/faicons/)
|
||||
|
||||
[fontawesome.com](https://fontawesome.com/icons?d=gallery)
|
||||
|
|
@ -1 +0,0 @@
|
|||
3a5bb0f2628d9251bbe7474c0535258784cf770b
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
# markdown 渲染器
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| url | markdown文件地址 | 非 | String | | 无 |
|
||||
| source | markdown内容 | 非 | String | | 无 |
|
||||
| highlight | 代码高亮 | 非 | Boolean | | false |
|
||||
| baidupan | 百度网盘分享链接显示优化 | 非 | Boolean | | true |
|
||||
|
||||
## 使用方法
|
||||
|
||||
加载一个.md文件
|
||||
|
||||
``` vue
|
||||
<d2-markdown url="/static/md/xxxx.md"/>
|
||||
```
|
||||
|
||||
加载资源
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<d2-markdown :source="doc"/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const doc = `
|
||||
# Header
|
||||
|
||||
## title
|
||||
|
||||
text`.trim()
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
doc
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
D2Admin 已经帮你配置好 webpack,你可以使用以下方式加载 markdown 文件
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<d2-markdown :source="doc"/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import doc from './md/doc.md'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
doc
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
## 百度网盘分享链接优化
|
||||
|
||||
当书写类似下面的分享链接时
|
||||
|
||||
::: tip
|
||||
需要 `baidupan = true`
|
||||
:::
|
||||
|
||||
```
|
||||
普通分享链接
|
||||
|
||||
> https://pan.baidu.com/s/1kW6uUwB
|
||||
|
||||
私密分享链接
|
||||
|
||||
> 链接: https://pan.baidu.com/s/1ggFW21l 密码: 877y
|
||||
```
|
||||
|
||||
markdown 中引用部分的文本由于被识别为百度云的分享链接,所以不会被当做 `blockquote` 渲染(非百度云链接的引用行不会改变),会以一种特别的块来显示,效果见下
|
||||
|
||||

|
||||
|
||||
::: tip
|
||||
了解 D2Admin 是如何在 markdown 中匹配百度云链接的? [查看源码](https://github.com/d2-projects/d2-admin/blob/master/src/components/core/d2-markdown/index.vue)
|
||||
:::
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
# 介绍
|
||||
|
||||
D2Admin 是一个开源的管理系统前端集成方案
|
||||
|
||||
<div>
|
||||
<iframe src="//ghbtns.com/github-btn.html?user=d2-projects&repo=d2-admin&type=star&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
<iframe src="//ghbtns.com/github-btn.html?user=d2-projects&repo=d2-admin&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
</div>
|
||||
|
||||
本项目仓库在 Github 和 Gitee 同步发布
|
||||
|
||||
[中文文档](http://d2admin.fairyever.com/zh/)
|
||||
|
||||
**完整版**
|
||||
|
||||
[Github 仓库](https://github.com/d2-projects/d2-admin) |
|
||||
[码云仓库](https://gitee.com/fairyever/d2-admin) |
|
||||
[预览地址](https://fairyever.gitee.io/d2-admin-preview)
|
||||
|
||||
**简化版模板**
|
||||
|
||||
[Github 仓库](https://github.com/d2-projects/d2-admin-start-kit) |
|
||||
[码云仓库](https://gitee.com/fairyever/d2-admin-start-kit) |
|
||||
[预览地址](https://fairyever.gitee.io/d2-admin-start-kit-preview/#/index)
|
||||
|
||||

|
||||
|
||||
D2Admin 完整版集成了很多的插件和组件,首次加载会占用很多的时间,所以加入了首屏加载动画。
|
||||
|
||||
如果您欣赏 D2Admin 的设计风格,希望基于它开发您的管理系统,**建议使用 [d2-admin-start-kit 简化模板](https://github.com/d2-projects/d2-admin-start-kit)**,简化版模板保留了所有的系统功能,包括登陆注销,主题切换,图标,数据持久化等。其它不必要的组件和插件您可以参照 D2Admin 完整版自行加入。
|
||||
|
||||
如果您执意在完整版基础上开发,请您在发布之前一定要删除没有用到的代码,比如项目没有用到图表、示例、插件组件。
|
||||
|
||||
D2Admin 是完全开源免费的管理系统集成方案,由 [FairyEver](https://github.com/FairyEver) 工作之余完完成(希望您看到这里,可以移步 [Github](https://github.com/d2-projects/d2-admin) 点个 star 支持我),如果你也一样喜欢前端开发,欢迎加入我们的讨论/学习群,群内可以`提问答疑`,`分享学习资料`。
|
||||
|
||||

|
||||
|
||||
::: tip Thanks
|
||||
D2Admin 创建于2018年1月14日零点51分,四个月后在2018年5月26日正式发布,39天时间 star 突破 1k ,在此对所有的 D2Admin 支持者表示感谢,项目将会保持更新,如果你有想法、建议、或者问题欢迎加群讨论
|
||||
|
||||
—— 2018年7月5日
|
||||
:::
|
||||
|
||||
> 1000 star 后 D2Admin 现已由一人维护改为归属于 [D2 Projects Organizations](https://github.com/d2-projects) 由多人维护
|
||||
|
||||
## 功能
|
||||
|
||||
* 首屏加载等待动画 避免首次加载白屏尴尬
|
||||
* 简约主题
|
||||
* 每个插件和组件都配有介绍文档
|
||||
* 图片资源 sketch 源文件( 可以在这个文件内重新生成所有图片资源 )
|
||||
* 登陆和注销
|
||||
* 根据路由自动生成菜单
|
||||
* 可折叠侧边栏
|
||||
* 方便的菜单设置
|
||||
* 多国语言支持
|
||||
* 富文本编辑器
|
||||
* Markdown 编辑器
|
||||
* 全屏功能
|
||||
* Fontawesome 图标库
|
||||
* 图标选择器(组件)
|
||||
* 自动引入下载的 SVG 图标
|
||||
* 前端假数据支持( mock )
|
||||
* 集成蚂蚁金服出品的 G2 图表
|
||||
* 图表自适应可拖拽大小的卡片容器(示例)
|
||||
* 简化剪贴板操作
|
||||
* 简化Cookie操作
|
||||
* 时间日期计算工具
|
||||
* 导入 Excel ( xlsx 格式 + csv 格式 )
|
||||
* 数据导出 Excel ( xlsx 格式 + csv 格式 )
|
||||
* 数据导出文本
|
||||
* 数字动画
|
||||
* 可拖拽调整大小的切分布局
|
||||
* 可拖拽调整大小和位置的网格布局
|
||||
* 提供三种方便的页面容器组件(正常卡片,隐形容器,填满页面)
|
||||
* 代码高亮显示
|
||||
* 加载并解析(或者直接指定资源) markdown 文件
|
||||
* GitHub 样式的 markdown 显示组件
|
||||
* markdown 内代码高亮
|
||||
* 为 markdown 扩展了百度云链接解析和优化显示
|
||||
* 右键菜单组件
|
||||
* 自定义滚动条和滚动控制
|
||||
* 内置5种主题
|
||||
* 公用样式抽离,方便的主题定制
|
||||
* 支持百万级数据量的表格组件
|
||||
* 打包后随意目录部署(已经做好兼容设置)
|
||||
* 支持临时菜单配置
|
||||
* 提供“试验台”功能 方便展示系统功能调用方法 `1.1.4 +`
|
||||
* 多标签页模式 `1.1.4 +`
|
||||
* 美化滚动条 `1.1.4 +`
|
||||
* json view `1.1.4 +`
|
||||
|
||||
## TODO
|
||||
|
||||
D2Admin 仍然处于开发中,这里有一些暂时的计划:
|
||||
|
||||
* 分离出简化版本
|
||||
* 推出基于 [ice](https://alibaba.github.io/ice) 平台的版本
|
||||
* 增加右上角通知中心
|
||||
* 增加一些实例页面以提供业务页面布局建议
|
||||
* 面包屑导航
|
||||
* 树型表格组件
|
||||
* 更多类型的编辑器
|
||||
* socket 连接
|
||||
* 浏览器版本提示
|
||||
* 日志控制台
|
||||
* d2-container 组件 ghost 模式和 full 模式合并
|
||||
* `1.1.4 已完成` 自定义滚动条
|
||||
* `1.1.4 已完成` 多 tab 页结构
|
||||
* `1.1.3 已完成` 更换图表库
|
||||
* `1.1.0 已完成` 抽离项目里的文档,集中存放在文档站点
|
||||
* `1.1.0 已完成` 对主界面进行一次完善,调整整体布局和颜色
|
||||
* `1.1.0 已完成` 切换主题功能
|
||||
|
||||
欢迎你为 D2Admin 的开发作出贡献(代码编写/文档翻译)。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
├─ build
|
||||
├─ config
|
||||
├─ deploy
|
||||
├─ dist
|
||||
├─ docs // 文档
|
||||
├─ src
|
||||
│ ├─ assets // 资源
|
||||
│ │ ├─ icons
|
||||
│ │ ├─ image
|
||||
│ │ ├─ library
|
||||
│ │ └─ style
|
||||
│ ├─ components // 组件
|
||||
│ │ ├─ charts // 图表组件
|
||||
│ │ ├─ core // 核心组件
|
||||
│ │ └─ demo // 示例组件
|
||||
│ ├─ i18n // 多国语
|
||||
│ ├─ libs // 通用库
|
||||
│ ├─ menu // 菜单
|
||||
│ ├─ mock // 模拟数据
|
||||
│ ├─ pages // 页面
|
||||
│ ├─ plugin // 插件
|
||||
│ ├─ router // 路由
|
||||
│ ├─ store // vuex
|
||||
│ ├─ App.vue
|
||||
│ └─ main.js
|
||||
├─ static // 静态资源
|
||||
├─ .babelrc
|
||||
├─ .editorconfig
|
||||
├─ .eslintignore
|
||||
├─ .eslintrc.js
|
||||
├─ .gitattributes
|
||||
├─ .gitignore
|
||||
├─ .postcssrc.js
|
||||
├─ LICENSE
|
||||
├─ README.md
|
||||
├─ index.html
|
||||
└─ package.json
|
||||
```
|
||||
|
||||
## 获取代码
|
||||
|
||||
有两种方式可以获得 D2Admin 的代码
|
||||
|
||||
* 在 [releases](https://github.com/d2-projects/d2-admin/releases) 页面下载最新的发行版。发行版一般是完成了某个大升级或者修复重要 bug 后发布的压缩包,你可以下载下来直接使用
|
||||
|
||||
* Fork 仓库到你的 github 然后克隆到本地,然后使用 master 分支继续你的开发。这种方式得到的是最新的代码,但是会有未完成的新功能。**不建议使用这种方式**
|
||||
|
||||
* 由于 github 访问较慢,推荐前往码云仓库下载 [gitee.com/fairyever/d2-admin](https://gitee.com/fairyever/d2-admin),码云上的仓库**在每次发布版本或者修复 bug 才会更新**,所以如果你选择此方法,请直接 fork 仓库并克隆到本地
|
||||
|
||||
> 码云的仓库由 github 同步,但是发行版和标签同步有一些问题,所以推荐直接 fork 仓库
|
||||
|
||||
## 使用
|
||||
|
||||
```
|
||||
// 安装依赖
|
||||
npm i
|
||||
|
||||
// 运行
|
||||
npm run dev
|
||||
|
||||
// 打包
|
||||
npm run build
|
||||
```
|
||||
|
||||
> 如果上述步骤出现错误,建议您升级 node 版本 > 8,如果有其它疑问请参考[常见问题](/zh/guide/question.html)
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
# 更新日志
|
||||
|
||||
## v1.1.5 master ready
|
||||
|
||||
* [ 修改 ] 全局状态管理设计优化
|
||||
* [ 修改 ] 多标签页操作全部转移至 vuex
|
||||
* [ 修改 ] 修复了多标签页无法清除缓存的 bug
|
||||
|
||||
## v1.1.4
|
||||
|
||||
* [ 修改 ] 全局状态管理设计优化
|
||||
* [ 修改 ] 主题调优
|
||||
* [ 新增 ] playground 模块,方便测试和展示一些功能实现方式/调用方法
|
||||
* [ 新增 ] 灰度模式
|
||||
* [ 新增 ] 多页模式
|
||||
* [ 新增 ] 多页模式缓存
|
||||
* [ 新增 ] 多页模式快速关闭(关闭左侧 右侧 全部 其它)
|
||||
* [ 修改 ] 侧边栏滚动优化
|
||||
* [ 新增 ] `d2-container` 填充模式自定义滚动条
|
||||
* [ 新增 ] `d2-container` 组件卡片和隐形模式自定义滚动条
|
||||
* [ 新增 ] 现在页面标题可以根据路由做出对应变化了
|
||||
* [ 新增 ] 版本检查机制
|
||||
* [ 新增 ] `d2-container` 隐形模式支持 header 插槽
|
||||
* [ 新增 ] 版本检查可以设置为不显示提示框
|
||||
* [ 新增 ] 集成 json 查看组件
|
||||
* [ 新增 ] 添加了所有图表种类的演示页面
|
||||
* [ 修改 ] 修改布局方式,解决了在 Firefox 上 better-scroll 初始化拿不到正确高度的 bug
|
||||
* [ 新增 ] 右上角显示用户名,用户名持久存储
|
||||
|
||||
## v1.1.3
|
||||
|
||||
* [ 修复 ] 侧边栏在折叠时不显示的 bug
|
||||
* [ 新增 ] v-charts 插件
|
||||
* [ 新增 ] 一些演示图表(后续打算把 v-charts 文档上有示例性的演示都展示一下)
|
||||
* [ 修改 ] D2Admin 经典主题颜色调整
|
||||
* [ 新增 ] violet 主题
|
||||
* [ 新增 ] 菜单图标
|
||||
* [ 修改 ] 新制作了 Fork me 图片
|
||||
|
||||
## v1.1.2
|
||||
|
||||
* [ 修改 ] 删除了 G2 相关的依赖
|
||||
|
||||
## v1.1.1
|
||||
|
||||
* [ 修改 ] 删除了 G2 相关的代码(移除图表库)
|
||||
* [ 优化 ] 侧边栏取值逻辑
|
||||
|
||||
## v1.1.0
|
||||
|
||||
* [ 修改 ] 顶栏和侧边栏菜单新的结构生成方式,新的方案使用 数据 + 递归组件 实现无限制多级菜单
|
||||
* [ 修改 ] 路由注册回归最简单的写法
|
||||
* [ 修复 ] 首次加载 loading 样式类名和程序内类名冲突,新的加载类名使用 d2-app-loading 前缀
|
||||
* [ 修改 ] 所有类似 dd- 的样式前缀(包括自动注册图标的id前缀)统一改为 d2-
|
||||
* [ 修复 ] 修复 d2-highlight 组件和 d2-markdown 组件的样式冲突
|
||||
* [ 修改 ] 内置组件名称统一改为 d2- 前缀,统一使用横线连接 (kebab-case) 风格
|
||||
* [ 修改 ] 顶栏 logo 阴影删除
|
||||
* [ 新增 ] 主题系统
|
||||
* [ 新增 ] 三个主题,分别为 d2admin 经典,简约线条,流星
|
||||
* [ 修改 ] d2-markdown 组件 md 参数改名为 source
|
||||
* [ 修改 ] 删除了 d2-markdown 组件中图片的白色背景
|
||||
* [ 修改 ] 删除 timeago 插件,更换为更强大的 dayjs
|
||||
* [ 新增 ] Tomorrow Night Blue 主题
|
||||
* [ 修改 ] src/assets/style/public-class.scss 写法优化
|
||||
* [ 新增 ] [vue-bigdata-table](https://github.com/lison16/vue-bigdata-table)组件
|
||||
* [ 修复 ] 侧边栏内容超过一屏后显示错误
|
||||
* [ 新增 ] 自定义滚动条演示页面
|
||||
* [ 新增 ] 流星主题新增背景图片上层的半透明遮罩
|
||||
* [ 修复 ] 主题设置失效bug
|
||||
* [ 修复 ] router守卫验证登陆部分代码修改
|
||||
* [ 修复 ] d2-container 组件改为同步注册(之前的异步注册会有 mounted 生命周期问题,即 slot 内的页面在 mounted 生命周期内拿不到 dom)
|
||||
* [ 修复 ] d2-container 组件重构 flex 布局
|
||||
* [ 新增 ] 404 page
|
||||
* [ 新增 ] 顶栏联系方式
|
||||
* [ 新增 ] 右键菜单组件
|
||||
* [ 新增 ] 菜单配置支持空菜单(项目开发的时候有可能需要先把菜单做好查看效果)
|
||||
* [ 优化 ] 页面左侧菜单滚动条优化
|
||||
* [ 修复 ] CSS 边距工具类都加上了 `!important` 来保证在覆盖样式时生效
|
||||
* [ 修复 ] IE11 兼容性修复
|
||||
|
||||
## v1.0.0
|
||||
|
||||
[https://github.com/d2-projects/d2-admin/releases/tag/v1.0.0](https://github.com/d2-projects/d2-admin/releases/tag/v1.0.0)
|
||||
|
||||
这是第一个版本,还有一点小问题,但是已经可用
|
||||
|
|
@ -1 +0,0 @@
|
|||
f7a47389e6c0773e9d218227678ebb8850ea87e8
|
||||
|
|
@ -1 +0,0 @@
|
|||
27e431bd9e4752dd51fe827a1281d606bd7bdf07
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# 贡献指南
|
||||
|
||||
## 如何贡献代码
|
||||
|
||||
首先在[项目主页](https://github.com/d2-projects/d2-admin) fork 本仓库,然后进行你的开发,请确保你的开发是在 **dev** 分支进行。本地测试无误后方可 pull request,我在检查通过后会合并代码到原始仓库。
|
||||
|
||||
## 要求
|
||||
|
||||
本项目代码需要符合[vue.js 风格指南](https://cn.vuejs.org/v2/style-guide/)中[优先级A](https://cn.vuejs.org/v2/style-guide/#%E4%BC%98%E5%85%88%E7%BA%A7-A-%E7%9A%84%E8%A7%84%E5%88%99%EF%BC%9A%E5%BF%85%E8%A6%81%E7%9A%84-%E8%A7%84%E9%81%BF%E9%94%99%E8%AF%AF)和[优先级B](https://cn.vuejs.org/v2/style-guide/#%E4%BC%98%E5%85%88%E7%BA%A7-B-%E7%9A%84%E8%A7%84%E5%88%99%EF%BC%9A%E5%BC%BA%E7%83%88%E6%8E%A8%E8%8D%90-%E5%A2%9E%E5%BC%BA%E5%8F%AF%E8%AF%BB%E6%80%A7)的要求以及本项目中的 ESlint 校验
|
||||
|
||||
::: tip
|
||||
由于项目初始没有仔细遵循风格指南,可能项目代码中已经存在不符合规范的代码,欢迎批评指正或者直接pr
|
||||
:::
|
||||
|
|
@ -1,329 +0,0 @@
|
|||
# 常见问题
|
||||
|
||||
本章总结收到的用户反馈问题,集中展示,方便后续用户自助解决问题
|
||||
|
||||
## 无法启动项目
|
||||
|
||||
如果在 `run dev` 或者 `npm i` 的过程中报错,首先建议您升级 node 版本 > 8,在以下环境测试可用
|
||||
|
||||
``` {10}
|
||||
➜ ~ npm -v
|
||||
5.6.0
|
||||
➜ ~ node -v
|
||||
v8.11.1
|
||||
➜ ~ nrm -V
|
||||
1.0.2
|
||||
➜ ~ nrm ls
|
||||
npm ---- https://registry.npmjs.org/
|
||||
cnpm --- http://r.cnpmjs.org/
|
||||
* taobao - https://registry.npm.taobao.org/
|
||||
nj ----- https://registry.nodejitsu.com/
|
||||
rednpm - http://registry.mirror.cqupt.edu.cn/
|
||||
npmMirror https://skimdb.npmjs.com/registry/
|
||||
edunpm - http://registry.enpmjs.org/
|
||||
```
|
||||
|
||||
::: tip
|
||||
推荐使用 [nrm](https://github.com/Pana/nrm) 管理 npm 源,不建议使用 cnpm
|
||||
:::
|
||||
|
||||
在正在开发的 1.2.x 版本(也有可能在你看到这的时候版本已经比 1.2.x 更晚)中,我们不再使用 npm 作为推荐的包安装工具,取而代之的是使用 [yarn](https://yarnpkg.com/zh-Hans/),使用方法如下
|
||||
|
||||
```
|
||||
// 安装依赖
|
||||
yarn
|
||||
// 启动调试服务
|
||||
yarn run serve
|
||||
```
|
||||
|
||||
## node-sass 安装失败
|
||||
|
||||
由于某些不可描述的原因,利用 npm 进行安装模块的时候会发生包下载失败的情况,node-sass 尤其的频繁,或者说 node-sass 的二进制文件是接近百分百失败的,即使用 yarn 安装也依旧在这个点失败,给出以下建议
|
||||
|
||||
**方法1**
|
||||
|
||||
首先,需要提前下载 node-sass 的二进制文件,这个文件可以去 cnpm 仓库下载或者 node-sass 的 github 上去下载,在下载之前我们需要先查看电脑的系统的版本,来确定适合哪个版本的二进制文件,查看版本的指令如下:
|
||||
|
||||
``` sh
|
||||
node -p "[process.platform, process.arch, process.versions.modules].join('-')"
|
||||
```
|
||||
|
||||
输入这个指令后会弹出一个系统版本,然后在下面两个地址中选择一个去下载对应系统版本的后缀为 .node 的 node-sass 文件
|
||||
|
||||
[cnpm https://npm.taobao.org/mirrors/node-sass/](https://npm.taobao.org/mirrors/node-sass/)
|
||||
|
||||
[github https://github.com/sass/node-sass/releases](https://github.com/sass/node-sass/releases)
|
||||
|
||||
下载完保存到任意位置,最好放置到 package.json 所在位置。然后我们需要手动指定 node-sass 二进制文件的下载源为下载的那个文件,以下是npm与yanr的指令:
|
||||
|
||||
npm
|
||||
|
||||
``` sh
|
||||
npm config set sass-binary-path 你存放刚才下载的二进制文件的目录
|
||||
// 例如 npm config set sass-binary-path e:/web/win32-x64-48_binding.node
|
||||
```
|
||||
|
||||
yarn
|
||||
|
||||
``` sh
|
||||
yarn config set sass-binary-path 你存放刚才下载的二进制文件的目录
|
||||
// 例如 yarn config set sass-binary-path e:/web/win32-x64-48_binding.node
|
||||
```
|
||||
|
||||
然后我们即可用正常指令下载了
|
||||
|
||||
::: tip 注意
|
||||
此方法会绑定为本地文件,即无法更新 node-sass 了。如果不希望这样,请使用第二种方法
|
||||
:::
|
||||
|
||||
**方法2**
|
||||
|
||||
此方案将把下载源指定为cnpm仓库,更建议使用这种方法
|
||||
|
||||
全部的下载源指向cnpm的指令
|
||||
|
||||
npm
|
||||
|
||||
``` sh
|
||||
npm config set registry http://registry.npm.taobao.org
|
||||
```
|
||||
|
||||
yarn
|
||||
|
||||
``` sh
|
||||
yarn config set registry http://registry.npm.taobao.org
|
||||
```
|
||||
|
||||
只指定node-sass的下载源(建议使用)
|
||||
|
||||
npm
|
||||
|
||||
``` sh
|
||||
npm config set sass-binary-site http://npm.taobao.org/mirrors/node-sass
|
||||
```
|
||||
|
||||
yarn
|
||||
|
||||
``` sh
|
||||
yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass
|
||||
```
|
||||
|
||||
## 无法跳转路由
|
||||
|
||||
有可能你在 D2Admin 的基础上进行你的开发时,发现在登陆页面进行
|
||||
|
||||
``` js
|
||||
this.$router.push({ name: 'index' })
|
||||
```
|
||||
|
||||
跳转的时候页面并没有跳转,这是因为你很有可能没有进行下面的操作:
|
||||
|
||||
``` js
|
||||
Cookies.set('token', res.token, setting)
|
||||
```
|
||||
|
||||
原因根源是在 `src/router/index.js` 中有如下一段代码,根据 `token` 判断用户是否登陆
|
||||
|
||||
``` js {3-9}
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.matched.some(r => r.meta.requiresAuth)) {
|
||||
if (Cookies.get('token')) {
|
||||
next()
|
||||
} else {
|
||||
next({
|
||||
name: 'login'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
所以如果你没有存 token 字段在 cookie 中,路由鉴权机制将会重定向到登录页
|
||||
|
||||
如果你想修改基于 token 验证用户登陆状态的机制,请在 `./src` 下搜索 `token` 关键字并修改他们,但是我**十分不建议你修改它们**
|
||||
|
||||
最好的做法是在登陆后返回本次登陆的 token 并且存储在 cookie 中,然后在每次 ajax 请求时都携带这个 token 给后端做权限验证(必要的话你可以还可以增加 token 的更新机制)
|
||||
|
||||
::: tip 同样需要注意的地方
|
||||
除了需要在 cookie 中保存 token,你还要保存 uuid 字段,意为“用户唯一标识”
|
||||
|
||||
``` js
|
||||
Cookies.set('uuid', res.uuid, setting)
|
||||
```
|
||||
|
||||
D2Admin 会在很多地方使用 cookie 中的此字段区分用户,比如不同用户选择的不同主题的数据持久化,还有不同用户打开的多标签页数据的持久化存储。
|
||||
:::
|
||||
|
||||
## 文档运行报错
|
||||
|
||||
这里目前还有一个小遗憾,d2admin 使用的 webpack 版本不能符合 vuepress 的要求,所以如果你想在本地启动文档站点的服务,需要按下述步骤
|
||||
|
||||
首先将 vuepress 安装到全局
|
||||
|
||||
``` sh
|
||||
npm i -g vuepress
|
||||
```
|
||||
|
||||
启动服务
|
||||
|
||||
``` sh
|
||||
npm run doc:dev
|
||||
```
|
||||
|
||||
::: tip
|
||||
你可能会发现项目目录中有一个 deploy 文件夹,这个文件是为了方便发布和提交代码用的,通常你并不需要使用它
|
||||
:::
|
||||
|
||||
## 删除页面右上角 github 链接
|
||||
|
||||
在 `src/components/demo/d2-demo-page-cover/index.vue` 中删除相关代码即可
|
||||
|
||||
## 兼容性
|
||||
|
||||
首先 vue.js 和 ElementUI 做不到兼容的,D2Admin 肯定也兼容不了,实测在 macOS 下 Chrome 和新版本的火狐浏览器以及 Safari 都正常使用,这类管理系统一般是内部使用,通常不必太纠结兼容低版本浏览器,如果你发现了显示的 bug,可以加 QQ 群反应,如果你可以修复这个 bug 使其在你的浏览器上显示正常,欢迎你的 pr。
|
||||
|
||||
## 删除项目里的 G2 图表库
|
||||
|
||||
出于为用户考虑,作者个人实现的图表集成方案肯定不如其它专门做这方面的开源产品(这是肯定的,客观来讲作者的个人水平和 v-charts 的团队水平不在一个等级),所以G2 图表库在 `1.1.1` 版本删除,后续版本换成 `v-charts`。如果你在开始使用 D2Admin 是在 `1.1.0` 以及之前,你的项目里应该有 G2 图表库,如果你不想保留,下面的向导将会指导你删除它
|
||||
|
||||
::: tip
|
||||
下面的教程都是在 `1.1.0` 版本(行号为下载后没进行任何改动的行号)基础上
|
||||
:::
|
||||
|
||||
1. 删除相关路由
|
||||
|
||||
删除文件 `src/router/index.js` 中 **34 ~ 53** 行代码
|
||||
|
||||
``` js
|
||||
{
|
||||
path: '/demo/chart',
|
||||
name: 'demo-chart',
|
||||
meta,
|
||||
redirect: { name: 'demo-chart-index' },
|
||||
component: () => import('@/components/core/d2-layout-main'),
|
||||
children: (pre => [
|
||||
...
|
||||
])('demo-chart-')
|
||||
},
|
||||
```
|
||||
|
||||
2. 删除菜单
|
||||
|
||||
删除文件 `src/menu/index.js` 中 **119 ~ 143** 以及 **240** 和 **256** 行代码
|
||||
|
||||
``` js
|
||||
// 路由菜单 图表
|
||||
const demoChart = {
|
||||
path: '/demo/chart',
|
||||
title: '图表 G2',
|
||||
icon: 'pie-chart',
|
||||
children: (pre => [
|
||||
...
|
||||
])('/demo/chart/')
|
||||
}
|
||||
```
|
||||
|
||||
``` js {5,12}
|
||||
export const side = [
|
||||
demoPlugins,
|
||||
demoComponents,
|
||||
demoElement,
|
||||
demoChart // <- 注意这里
|
||||
]
|
||||
// 修改为
|
||||
export const side = [
|
||||
demoPlugins,
|
||||
demoComponents,
|
||||
demoElement
|
||||
// 删除了 demoChart
|
||||
]
|
||||
```
|
||||
|
||||
``` js {13,31}
|
||||
export default [
|
||||
{
|
||||
path: '/index',
|
||||
title: '首页'
|
||||
},
|
||||
{
|
||||
path: '/demo',
|
||||
title: '集成功能',
|
||||
children: [
|
||||
demoPlugins,
|
||||
demoComponents,
|
||||
demoElement,
|
||||
demoChart, // <- 注意这里
|
||||
{
|
||||
title: '空菜单演示',
|
||||
icon: 'folder-o',
|
||||
children: [ ...
|
||||
// 修改为
|
||||
export default [
|
||||
{
|
||||
path: '/index',
|
||||
title: '首页'
|
||||
},
|
||||
{
|
||||
path: '/demo',
|
||||
title: '集成功能',
|
||||
children: [
|
||||
demoPlugins,
|
||||
demoComponents,
|
||||
demoElement,
|
||||
// 删除了 demoChart
|
||||
{
|
||||
title: '空菜单演示',
|
||||
icon: 'folder-o',
|
||||
children: [ ...
|
||||
```
|
||||
|
||||
3. 删除文件
|
||||
|
||||
* 删除 `src/components/charts` 目录
|
||||
|
||||
* 删除 `src/components/index.js` 中的相关内容(高亮部分)
|
||||
|
||||
```js {5-6}
|
||||
// 核心组件
|
||||
import './core/register'
|
||||
// 非核心组件 只是在很多演示页面中用到的组件
|
||||
import './demo/register'
|
||||
// 图表组件
|
||||
import './charts/register'
|
||||
```
|
||||
|
||||
* 删除 `src/mock/chart` 目录
|
||||
|
||||
* 删除 `src/mock/register.js` 中的相关内容(高亮部分)
|
||||
|
||||
```js {7}
|
||||
import Mock from 'mockjs'
|
||||
|
||||
import '@/mock/ajax-demo'
|
||||
|
||||
import '@/mock/login'
|
||||
|
||||
import '@/mock/chart/register.js'
|
||||
|
||||
// 设置全局延时 没有延时的话有时候会检测不到数据变化 建议保留
|
||||
Mock.setup({
|
||||
timeout: '300-600'
|
||||
})
|
||||
```
|
||||
|
||||
* 删除 `src/pages/demo/chart` 目录
|
||||
|
||||
4. 删除依赖
|
||||
|
||||
打开终端 cd 到项目文件夹,执行
|
||||
|
||||
``` sh
|
||||
npm remove @antv/data-set -S
|
||||
npm remove @antv/g2 -S
|
||||
```
|
||||
|
||||
## 项目里有未完成的代码
|
||||
|
||||
有些示例(比如 v-charts 和 ElementUI)是很方便就可以找到官网示例和文档的,这些插件和组件的示例在本项目中就可能处于未完成的状态,但是以后会完成
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# 其它
|
||||
|
||||
这里主要是介绍一些其它的信息
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
# CSS 工具类
|
||||
|
||||
## 文字
|
||||
|
||||
| 类名 | 效果 |
|
||||
| --- | --- |
|
||||
| `.d2-text-center` | 文字水平居中 |
|
||||
|
||||
## 浮动
|
||||
|
||||
| 类名 | 效果 |
|
||||
| --- | --- |
|
||||
| `.d2-fl` | 左浮动 |
|
||||
| `.d2-fr` | 右浮动 |
|
||||
| `.d2-clearfix` | 清除浮动 |
|
||||
|
||||
## 边距
|
||||
|
||||
| 类名 | 效果 |
|
||||
| --- | --- |
|
||||
| `.d2-m-0` | 外边距 0px |
|
||||
| `.d2-mt-0` | 上外边距 0px |
|
||||
| `.d2-mr-0` | 右外边距 0px |
|
||||
| `.d2-mb-0` | 下外边距 0px |
|
||||
| `.d2-ml-0` | 左外边距 0px |
|
||||
| `.d2-p-0` | 内边距 0px |
|
||||
| `.d2-pt-0` | 上内边距 0px |
|
||||
| `.d2-pr-0` | 右内边距 0px |
|
||||
| `.d2-pb-0` | 下内边距 0px |
|
||||
| `.d2-pl-0` | 左内边距 0px |
|
||||
| `.d2-m-10` | 外边距 10px |
|
||||
| `.d2-mt-10` | 上外边距 10px |
|
||||
| `.d2-mr-10` | 右外边距 10px |
|
||||
| `.d2-mb-10` | 下外边距 10px |
|
||||
| `.d2-ml-10` | 左外边距 10px |
|
||||
| `.d2-p-10` | 内边距 10px |
|
||||
| `.d2-pt-10` | 上内边距 10px |
|
||||
| `.d2-pr-10` | 右内边距 10px |
|
||||
| `.d2-pb-10` | 下内边距 10px |
|
||||
| `.d2-pl-10` | 左内边距 10px |
|
||||
| `.d2-m-15` | 外边距 15px |
|
||||
| `.d2-mt-15` | 上外边距 15px |
|
||||
| `.d2-mr-15` | 右外边距 15px |
|
||||
| `.d2-mb-15` | 下外边距 15px |
|
||||
| `.d2-ml-15` | 左外边距 15px |
|
||||
| `.d2-p-15` | 内边距 15px |
|
||||
| `.d2-pt-15` | 上内边距 15px |
|
||||
| `.d2-pr-15` | 右内边距 15px |
|
||||
| `.d2-pb-15` | 下内边距 15px |
|
||||
| `.d2-pl-15` | 左内边距 15px |
|
||||
| `.d2-m-20` | 外边距 20px |
|
||||
| `.d2-mt-20` | 上外边距 20px |
|
||||
| `.d2-mr-20` | 右外边距 20px |
|
||||
| `.d2-mb-20` | 下外边距 20px |
|
||||
| `.d2-ml-20` | 左外边距 20px |
|
||||
| `.d2-p-20` | 内边距 20px |
|
||||
| `.d2-pt-20` | 上内边距 20px |
|
||||
| `.d2-pr-20` | 右内边距 20px |
|
||||
| `.d2-pb-20` | 下内边距 20px |
|
||||
| `.d2-pl-20` | 左内边距 20px |
|
||||
|
||||
## 边距简写
|
||||
|
||||
20px 设定为通用边距 可以如下简写
|
||||
|
||||
| 类名 | 效果 |
|
||||
| --- | --- |
|
||||
| `.d2-m` | 外边距 20px |
|
||||
| `.d2-mt` | 上外边距 20px |
|
||||
| `.d2-mr` | 右外边距 20px |
|
||||
| `.d2-mb` | 下外边距 20px |
|
||||
| `.d2-ml` | 左外边距 20px |
|
||||
| `.d2-p` | 内边距 20px |
|
||||
| `.d2-pt` | 上内边距 20px |
|
||||
| `.d2-pr` | 右内边距 20px |
|
||||
| `.d2-pb` | 下内边距 20px |
|
||||
| `.d2-pl` | 左内边距 20px |
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# 插件概述
|
||||
|
||||
d2-admin(以下简称 d2admin)封装(或者集成第三方)了一些插件,方便开发者进行开发,具体组件文档请从左侧列表进入
|
||||
|
||||
::: tip
|
||||
这里只列出一部分需要特别说明的插件,大部分集成的插件都可以在网络上找到官方文档
|
||||
:::
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
# 表格导出
|
||||
|
||||
本框架集成了数据导出功能,并包装成插件
|
||||
|
||||
## 注册插件
|
||||
|
||||
``` js
|
||||
import pluginExport from '@/plugin/export'
|
||||
Vue.use(pluginExport)
|
||||
```
|
||||
|
||||
之后就可以在组件中使用 `this.$export` 来调用导出功能
|
||||
|
||||
::: tip
|
||||
d2admin 已经帮你注册好,可以直接使用,无需写上面的代码
|
||||
:::
|
||||
|
||||
## 导出 csv
|
||||
|
||||
此方法将数据以 `csv` 格式导出,并且返回一个 `Promise` 对象
|
||||
|
||||
使用
|
||||
|
||||
``` js
|
||||
this.$export.csv({
|
||||
columns,
|
||||
data
|
||||
})
|
||||
.then(() => {
|
||||
// ...可选回调
|
||||
})
|
||||
```
|
||||
|
||||
参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| columns | 列 | 非 | Array | | 空数组 |
|
||||
| data | 行数据 | 非 | Array | | 空数组 |
|
||||
| title | 文件名 | 非 | String | | table |
|
||||
| noHeader | 不导出表头 | 非 | Boolean | | false |
|
||||
| separator | 数据分隔符 | 非 | String | | , |
|
||||
| quoted | 每项数据是否加引号 | 非 | Boolean | | false |
|
||||
|
||||
示例
|
||||
|
||||
``` js
|
||||
const columns = [
|
||||
{
|
||||
label: '姓名',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
label: '年龄',
|
||||
prop: 'age'
|
||||
}
|
||||
]
|
||||
const data = [
|
||||
{
|
||||
name: 'lucy',
|
||||
age: 24
|
||||
},
|
||||
{
|
||||
name: 'bob',
|
||||
age: 26
|
||||
}
|
||||
]
|
||||
this.$export.csv({
|
||||
columns,
|
||||
data
|
||||
})
|
||||
```
|
||||
|
||||
## 导出 xlsx
|
||||
|
||||
此方法将数据以 `xlsx` 格式导出,并且返回一个 `Promise` 对象
|
||||
|
||||
使用
|
||||
|
||||
``` js
|
||||
this.$export.excel({
|
||||
columns,
|
||||
data
|
||||
})
|
||||
.then(() => {
|
||||
// ...可选回调
|
||||
})
|
||||
```
|
||||
|
||||
参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| columns | 列 | 非 | Array | | 空数组 |
|
||||
| data | 行数据 | 非 | Array | | 空数组 |
|
||||
| title | 文件名 | 非 | String | | table |
|
||||
|
||||
示例
|
||||
|
||||
``` js
|
||||
const columns = [
|
||||
{
|
||||
label: '姓名',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
label: '年龄',
|
||||
prop: 'age'
|
||||
}
|
||||
]
|
||||
const data = [
|
||||
{
|
||||
name: 'lucy',
|
||||
age: 24
|
||||
},
|
||||
{
|
||||
name: 'bob',
|
||||
age: 26
|
||||
}
|
||||
]
|
||||
this.$export.excel({
|
||||
columns,
|
||||
data
|
||||
})
|
||||
```
|
||||
|
||||
## 导出 txt
|
||||
|
||||
此方法将数据以 `txt` 格式导出,并且返回一个 `Promise` 对象
|
||||
|
||||
使用
|
||||
|
||||
``` js
|
||||
this.$export.txt({
|
||||
text: '文本内容',
|
||||
title: '文件名'
|
||||
})
|
||||
.then(() => {
|
||||
// ...可选回调
|
||||
})
|
||||
```
|
||||
|
||||
参数
|
||||
|
||||
| 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| text | 文件内容 | 非 | String | | 空 |
|
||||
| title | 文件名 | 非 | String | | 文本 |
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# 表格导入
|
||||
|
||||
本框架集成了数据导入功能,并包装成插件
|
||||
|
||||
## 注册插件
|
||||
|
||||
``` js
|
||||
import pluginImport from '@/plugin/import'
|
||||
Vue.use(pluginImport)
|
||||
```
|
||||
|
||||
之后就可以在组件中使用 `this.$import` 来调用导出功能
|
||||
|
||||
::: tip
|
||||
d2admin 已经帮你注册好,可以直接使用,无需写上面的代码
|
||||
:::
|
||||
|
||||
## 导入 csv
|
||||
|
||||
导入csv文件,并且返回一个 `Promise` 对象
|
||||
|
||||
``` js
|
||||
// 在选择文件后调用
|
||||
handleUpload (file) {
|
||||
this.$import.csv(file)
|
||||
.then(res => {
|
||||
this.table.columns = Object.keys(res.data[0]).map(e => ({
|
||||
label: e,
|
||||
prop: e
|
||||
}))
|
||||
this.table.data = res.data
|
||||
})
|
||||
// 阻止默认的上传
|
||||
return false
|
||||
}
|
||||
```
|
||||
|
||||
## 导入 xlsx
|
||||
|
||||
导入xlsx文件,并且返回一个 `Promise` 对象
|
||||
|
||||
**注意 导入的表格文件第一行应为表头**
|
||||
|
||||
参考下述示例使用
|
||||
|
||||
``` js
|
||||
// 在选择文件后调用
|
||||
handleUpload (file) {
|
||||
this.$import.xlsx(file)
|
||||
.then(({header, results}) => {
|
||||
// header 为表头
|
||||
// results 为内容
|
||||
this.table.columns = header.map(e => {
|
||||
return {
|
||||
label: e,
|
||||
prop: e
|
||||
}
|
||||
})
|
||||
this.table.data = results
|
||||
})
|
||||
// 阻止默认的上传
|
||||
return false
|
||||
}
|
||||
```
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
# 多国语
|
||||
|
||||
多国语插件
|
||||
|
||||
::: tip
|
||||
此文档仅限于演示如何在 `D2Admin` 中使用多国语言设置
|
||||
:::
|
||||
|
||||
公用的语言设置建议放在 `src/i18n` 下
|
||||
|
||||
i18n 文件夹结构如下所示
|
||||
|
||||
```
|
||||
|__index.js // 主文件
|
||||
|__lang // 语言配置文件夹
|
||||
| |__cn // 中文
|
||||
| | |__index.js // 中文 公用配置
|
||||
| |__ja // 日语
|
||||
| | |__index.js // 日语 公用配置
|
||||
| |__en // 英语
|
||||
| | |__index.js // 英语 公用配置
|
||||
```
|
||||
|
||||
在 `src/i18n/index.js` 中导入同级lang文件夹内的语言设置,并导出一个新的 `VueI18n` 实例供 `main.js` 使用
|
||||
|
||||
``` js
|
||||
import i18n from './i18n'
|
||||
new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
i18n, // 使用 i18n
|
||||
router,
|
||||
template: '<App/>',
|
||||
components: { App }
|
||||
})
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
使用 `$t('路径')`
|
||||
|
||||
``` vue
|
||||
<PageHeader
|
||||
slot="header"
|
||||
:title="`${$t('pub.pageHeader.demo')} 1`"
|
||||
url="http://kazupon.github.io/vue-i18n/en/">
|
||||
</PageHeader>
|
||||
```
|
||||
|
||||
## 局部配置
|
||||
|
||||
有时候我们只希望在某个文件中配置这个组件的多国语言,如果所有的语言设置都放在 `d2-admin/src/i18n` 中会造成混乱,不易维护
|
||||
|
||||
`D2Admin` 已经替你安装好了 `vue-i18n-loader`,可以方便地在单文件组件中使用
|
||||
|
||||
示例
|
||||
|
||||
``` vue
|
||||
<i18n src="./lang.json"></i18n>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<el-tag>{{$t('hello')}}</el-tag>
|
||||
<p>{{$t('check.title')}}</p>
|
||||
<el-checkbox-group v-model="check">
|
||||
<el-checkbox label="a">{{$t('check.label.Beijing')}}</el-checkbox>
|
||||
<el-checkbox label="b">{{$t('check.label.Tokyo')}}</el-checkbox>
|
||||
<el-checkbox label="c">{{$t('check.label.NewYork')}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
check: ['a', 'b']
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
在同一文件夹下的 `lang.json`
|
||||
|
||||
``` json
|
||||
{
|
||||
"cn": {
|
||||
"hello": "你好",
|
||||
"check": {
|
||||
"title": "请选择",
|
||||
"label": {
|
||||
"Beijing": "北京",
|
||||
"Tokyo": "东京",
|
||||
"NewYork": "纽约"
|
||||
}
|
||||
}
|
||||
},
|
||||
"en": {
|
||||
"hello": "hello",
|
||||
"check": {
|
||||
"title": "Please choose",
|
||||
"label": {
|
||||
"Beijing": "Beijing",
|
||||
"Tokyo": "Tokyo",
|
||||
"NewYork": "NewYork"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ja": {
|
||||
"hello": "こんにちは",
|
||||
"check": {
|
||||
"title": "選択してください",
|
||||
"label": {
|
||||
"Beijing": "北京",
|
||||
"Tokyo": "東京",
|
||||
"NewYork": "ニューヨーク"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
详细教程请查看官方文档,见此页右上角的链接
|
||||
|
|
@ -1,221 +0,0 @@
|
|||
# 模拟数据
|
||||
|
||||
在 `src/mock/demo/001.js` 配置拦截返回的数据
|
||||
|
||||
## 使用
|
||||
|
||||
``` js
|
||||
import Mock from 'mockjs'
|
||||
|
||||
Mock.mock('/api/demo/001', {
|
||||
'list|4-10': [{
|
||||
'id|+1': 1,
|
||||
'name': '@CNAME',
|
||||
'star|1-5': '★',
|
||||
'delFlag|1': [0, 1],
|
||||
'creatDate': '@DATE',
|
||||
'address': '@CITY',
|
||||
'zip': '@ZIP'
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
请求数据
|
||||
|
||||
``` js
|
||||
ajax () {
|
||||
this.$axios.get('/api/demo/001')
|
||||
.then(res => {
|
||||
this.table.columns = Object.keys(res.data.list[0]).map(e => ({
|
||||
label: e,
|
||||
prop: e
|
||||
}))
|
||||
this.table.data = res.data.list
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
## mock 语法规范
|
||||
|
||||
Mock.js 的语法规范包括两部分:
|
||||
|
||||
1. 数据模板定义规范(Data Template Definition,DTD)
|
||||
2. 数据占位符定义规范(Data Placeholder Definition,DPD)
|
||||
|
||||
### 数据模板定义规范 DTD
|
||||
|
||||
**数据模板中的每个属性由 3 部分构成:属性名、生成规则、属性值:**
|
||||
|
||||
``` js
|
||||
// 属性名 name
|
||||
// 生成规则 rule
|
||||
// 属性值 value
|
||||
'name|rule': value
|
||||
```
|
||||
|
||||
**注意:**
|
||||
|
||||
* _属性名_ 和 _生成规则_ 之间用竖线 `|` 分隔。
|
||||
* _生成规则_ 是可选的。
|
||||
* _生成规则_ 有 7 种格式:
|
||||
1. `'name|min-max': value`
|
||||
1. `'name|count': value`
|
||||
1. `'name|min-max.dmin-dmax': value`
|
||||
1. `'name|min-max.dcount': value`
|
||||
1. `'name|count.dmin-dmax': value`
|
||||
1. `'name|count.dcount': value`
|
||||
1. `'name|+step': value`
|
||||
* **_生成规则_ 的 含义 需要依赖 _属性值的类型_ 才能确定。**
|
||||
* _属性值_ 中可以含有 `@占位符`。
|
||||
* _属性值_ 还指定了最终值的初始值和类型。
|
||||
|
||||
<!-- 感谢 @麦少 同学对 Mock.js 语法的整理和分析,才有了这版相对清晰的语法文档。 -->
|
||||
|
||||
**生成规则和示例:**
|
||||
|
||||
#### 1. 属性值是字符串 **String**
|
||||
|
||||
1. `'name|min-max': string`
|
||||
|
||||
通过重复 `string` 生成一个字符串,重复次数大于等于 `min`,小于等于 `max`。
|
||||
|
||||
2. `'name|count': string`
|
||||
|
||||
通过重复 `string` 生成一个字符串,重复次数等于 `count`。
|
||||
|
||||
#### 2. 属性值是数字 **Number**
|
||||
|
||||
1. `'name|+1': number`
|
||||
|
||||
属性值自动加 1,初始值为 `number`。
|
||||
|
||||
2. `'name|min-max': number`
|
||||
|
||||
生成一个大于等于 `min`、小于等于 `max` 的整数,属性值 `number` 只是用来确定类型。
|
||||
|
||||
3. `'name|min-max.dmin-dmax': number`
|
||||
|
||||
生成一个浮点数,整数部分大于等于 `min`、小于等于 `max`,小数部分保留 `dmin` 到 `dmax` 位。
|
||||
|
||||
``` js
|
||||
Mock.mock({
|
||||
'number1|1-100.1-10': 1,
|
||||
'number2|123.1-10': 1,
|
||||
'number3|123.3': 1,
|
||||
'number4|123.10': 1.123
|
||||
})
|
||||
// =>
|
||||
{
|
||||
"number1": 12.92,
|
||||
"number2": 123.51,
|
||||
"number3": 123.777,
|
||||
"number4": 123.1231091814
|
||||
}
|
||||
```
|
||||
|
||||
#### 3. 属性值是布尔型 **Boolean**
|
||||
|
||||
1. `'name|1': boolean`
|
||||
|
||||
随机生成一个布尔值,值为 true 的概率是 1/2,值为 false 的概率同样是 1/2。
|
||||
|
||||
2. `'name|min-max': value`
|
||||
|
||||
随机生成一个布尔值,值为 `value` 的概率是 `min / (min + max)`,值为 `!value` 的概率是 `max / (min + max)`。
|
||||
|
||||
#### 4. 属性值是对象 **Object**
|
||||
|
||||
1. `'name|count': object`
|
||||
|
||||
从属性值 `object` 中随机选取 `count` 个属性。
|
||||
|
||||
2. `'name|min-max': object`
|
||||
|
||||
从属性值 `object` 中随机选取 `min` 到 `max` 个属性。
|
||||
|
||||
#### 5. 属性值是数组 **Array**
|
||||
|
||||
1. `'name|1': array`
|
||||
|
||||
从属性值 `array` 中随机选取 1 个元素,作为最终值。
|
||||
|
||||
2. `'name|+1': array`
|
||||
|
||||
从属性值 `array` 中顺序选取 1 个元素,作为最终值。
|
||||
|
||||
3. `'name|min-max': array`
|
||||
|
||||
通过重复属性值 `array` 生成一个新数组,重复次数大于等于 `min`,小于等于 `max`。
|
||||
|
||||
4. `'name|count': array`
|
||||
|
||||
通过重复属性值 `array` 生成一个新数组,重复次数为 `count`。
|
||||
|
||||
#### 6. 属性值是函数 **Function**
|
||||
|
||||
1. `'name': function`
|
||||
|
||||
执行函数 `function`,取其返回值作为最终的属性值,函数的上下文为属性 `'name'` 所在的对象。
|
||||
|
||||
#### 7. 属性值是正则表达式 **RegExp**
|
||||
|
||||
1. `'name': regexp`
|
||||
|
||||
根据正则表达式 `regexp` 反向生成可以匹配它的字符串。用于生成自定义格式的字符串。
|
||||
|
||||
``` js
|
||||
Mock.mock({
|
||||
'regexp1': /[a-z][A-Z][0-9]/,
|
||||
'regexp2': /\w\W\s\S\d\D/,
|
||||
'regexp3': /\d{5,10}/
|
||||
})
|
||||
// =>
|
||||
{
|
||||
"regexp1": "pJ7",
|
||||
"regexp2": "F)\fp1G",
|
||||
"regexp3": "561659409"
|
||||
}
|
||||
```
|
||||
|
||||
### 数据占位符定义规范 DPD
|
||||
|
||||
_占位符_ 只是在属性值字符串中占个位置,并不出现在最终的属性值中。
|
||||
|
||||
_占位符_ 的格式为:
|
||||
|
||||
```
|
||||
@占位符
|
||||
@占位符(参数 [, 参数])
|
||||
```
|
||||
|
||||
**注意:**
|
||||
|
||||
1. 用 `@` 来标识其后的字符串是 _占位符_。
|
||||
2. _占位符_ 引用的是 `Mock.Random` 中的方法。
|
||||
3. 通过 `Mock.Random.extend()` 来扩展自定义占位符。
|
||||
4. _占位符_ 也可以引用 _数据模板_ 中的属性。
|
||||
5. _占位符_ 会优先引用 _数据模板_ 中的属性。
|
||||
6. _占位符_ 支持 _相对路径_ 和 _绝对路径_。
|
||||
|
||||
``` js
|
||||
Mock.mock({
|
||||
name: {
|
||||
first: '@FIRST',
|
||||
middle: '@FIRST',
|
||||
last: '@LAST',
|
||||
full: '@first @middle @last'
|
||||
}
|
||||
})
|
||||
// =>
|
||||
{
|
||||
"name": {
|
||||
"first": "Charles",
|
||||
"middle": "Brenda",
|
||||
"last": "Lopez",
|
||||
"full": "Charles Brenda Lopez"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
ef1324a190d1bcb162d301749057d943990174c1
|
||||
|
|
@ -1 +0,0 @@
|
|||
f7a47389e6c0773e9d218227678ebb8850ea87e8
|
||||
|
|
@ -1 +0,0 @@
|
|||
27e431bd9e4752dd51fe827a1281d606bd7bdf07
|
||||
|
|
@ -1 +0,0 @@
|
|||
17502d4e47a0d11f5a1cec935f48229d7ed38fc8
|
||||
|
|
@ -1 +0,0 @@
|
|||
729a7896f93feaddd10e80dab4f5ff4ce05e64a8
|
||||
174
index.html
|
|
@ -1,174 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="shortcut icon" type="image/ico" href="/static/icon.ico" />
|
||||
<title>D2Admin</title>
|
||||
<style>
|
||||
html, body, #app {
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
.d2-app-loading-group {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
background: #757F9A;
|
||||
background: -webkit-linear-gradient(to top, #D7DDE8, #757F9A);
|
||||
background: linear-gradient(to top, #D7DDE8, #757F9A);
|
||||
}
|
||||
.d2-app-loading-title {
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 10px;
|
||||
letter-spacing: 0.2em;
|
||||
}
|
||||
.d2-app-loading-sub-title {
|
||||
color: #FFF;
|
||||
font-size: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.d2-app-loading-sub-info {
|
||||
color: #FFF;
|
||||
font-size: 10px;
|
||||
opacity: .8;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.d2-app-loading-btn {
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-color: #dcdfe6;
|
||||
color: #606266;
|
||||
-webkit-appearance: none;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
outline: none;
|
||||
margin: 0;
|
||||
transition: .1s;
|
||||
font-weight: 500;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
padding: 12px 20px;
|
||||
font-size: 14px;
|
||||
border-radius: 4px;
|
||||
/* 圆角 */
|
||||
padding: 7px 15px;
|
||||
border-radius: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.d2-app-loading-grid {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
.d2-app-loading-grid .d2-app-loading {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #FFF;
|
||||
float: left;
|
||||
-webkit-animation: d2-app-loading-grid-scale-delay 1.3s infinite ease-in-out;
|
||||
animation: d2-app-loading-grid-scale-delay 1.3s infinite ease-in-out;
|
||||
}
|
||||
.d2-app-loading-grid .d2-app-loading1 {
|
||||
border-top-left-radius: 4px;
|
||||
-webkit-animation-delay: 0.2s;
|
||||
animation-delay: 0.2s; }
|
||||
.d2-app-loading-grid .d2-app-loading2 {
|
||||
-webkit-animation-delay: 0.3s;
|
||||
animation-delay: 0.3s; }
|
||||
.d2-app-loading-grid .d2-app-loading3 {
|
||||
border-top-right-radius: 4px;
|
||||
-webkit-animation-delay: 0.4s;
|
||||
animation-delay: 0.4s; }
|
||||
.d2-app-loading-grid .d2-app-loading4 {
|
||||
-webkit-animation-delay: 0.1s;
|
||||
animation-delay: 0.1s; }
|
||||
.d2-app-loading-grid .d2-app-loading5 {
|
||||
-webkit-animation-delay: 0.2s;
|
||||
animation-delay: 0.2s; }
|
||||
.d2-app-loading-grid .d2-app-loading6 {
|
||||
-webkit-animation-delay: 0.3s;
|
||||
animation-delay: 0.3s; }
|
||||
.d2-app-loading-grid .d2-app-loading7 {
|
||||
border-bottom-left-radius: 4px;
|
||||
-webkit-animation-delay: 0s;
|
||||
animation-delay: 0s; }
|
||||
.d2-app-loading-grid .d2-app-loading8 {
|
||||
-webkit-animation-delay: 0.1s;
|
||||
animation-delay: 0.1s; }
|
||||
.d2-app-loading-grid .d2-app-loading9 {
|
||||
border-bottom-right-radius: 4px;
|
||||
-webkit-animation-delay: 0.2s;
|
||||
animation-delay: 0.2s; }
|
||||
|
||||
@-webkit-keyframes d2-app-loading-grid-scale-delay {
|
||||
0%, 70%, 100% {
|
||||
-webkit-transform: scale3D(1, 1, 1);
|
||||
transform: scale3D(1, 1, 1);
|
||||
} 35% {
|
||||
-webkit-transform: scale3D(0, 0, 1);
|
||||
transform: scale3D(0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes d2-app-loading-grid-scale-delay {
|
||||
0%, 70%, 100% {
|
||||
-webkit-transform: scale3D(1, 1, 1);
|
||||
transform: scale3D(1, 1, 1);
|
||||
} 35% {
|
||||
-webkit-transform: scale3D(0, 0, 1);
|
||||
transform: scale3D(0, 0, 1);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// 感谢您使用 D2Admin
|
||||
// D2Admin 完全开源免费,并且长期更新维护
|
||||
// 下面的百度统计代码不会拖慢您的应用速度也不会占用多少网络带宽,我们只是想统计一下我们的用户量
|
||||
// 所以希望您不要删除我们的统计代码,让我们知道有更多人的在使用,给我们继续开发的动力
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?20b202d9b1189c9352fc3e8c92c215fc";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="d2-app-loading-group">
|
||||
<div class="d2-app-loading-grid">
|
||||
<div class="d2-app-loading d2-app-loading1"></div>
|
||||
<div class="d2-app-loading d2-app-loading2"></div>
|
||||
<div class="d2-app-loading d2-app-loading3"></div>
|
||||
<div class="d2-app-loading d2-app-loading4"></div>
|
||||
<div class="d2-app-loading d2-app-loading5"></div>
|
||||
<div class="d2-app-loading d2-app-loading6"></div>
|
||||
<div class="d2-app-loading d2-app-loading7"></div>
|
||||
<div class="d2-app-loading d2-app-loading8"></div>
|
||||
<div class="d2-app-loading d2-app-loading9"></div>
|
||||
</div>
|
||||
<div class="d2-app-loading-title">加载中</div>
|
||||
<div class="d2-app-loading-sub-title">本示例项目加载了大量的组件,初次加载会比较慢,请耐心等待</div>
|
||||
<div class="d2-app-loading-sub-info">如果很久很久都没有加载成功,请清空缓存重新加载页面</div>
|
||||
<div style="margin-top: 10px;">
|
||||
<a class="d2-app-loading-btn" href="https://github.com/d2-projects/d2-admin" target="blank">Github仓库</a>
|
||||
<a class="d2-app-loading-btn" href="http://d2admin.fairyever.com/zh/" target="blank">中文文档</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
112
package.json
|
|
@ -1,112 +0,0 @@
|
|||
{
|
||||
"name": "d2-admin",
|
||||
"version": "1.1.4",
|
||||
"description": "A management system framework based on element",
|
||||
"author": "李杨 <1711467488@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||
"start": "npm run dev",
|
||||
"lint": "eslint --fix --ext .js,.vue src",
|
||||
"build": "node build/build.js",
|
||||
"doc:dev": "vuepress dev docs",
|
||||
"doc:build": "vuepress build docs"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.17.1",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"better-scroll": "^1.12.1",
|
||||
"clipboard-polyfill": "^2.4.1",
|
||||
"countup.js": "^1.9.3",
|
||||
"dayjs": "^1.6.7",
|
||||
"echarts": "^4.1.0",
|
||||
"element-ui": "^2.0.11",
|
||||
"file-saver": "^1.3.3",
|
||||
"github-markdown-css": "^2.10.0",
|
||||
"highlight.js": "^9.12.0",
|
||||
"js-cookie": "^2.2.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"lodash.uniqueid": "^4.0.1",
|
||||
"lowdb": "^1.0.0",
|
||||
"marked": "^0.3.9",
|
||||
"mockjs": "^1.0.1-beta3",
|
||||
"papaparse": "^4.3.6",
|
||||
"particles.js": "^2.0.0",
|
||||
"path-posix": "^1.0.0",
|
||||
"quill": "^1.3.4",
|
||||
"screenfull": "^3.3.2",
|
||||
"simplemde": "^1.11.2",
|
||||
"v-charts": "^1.17.6",
|
||||
"v-contextmenu": "^2.7.0",
|
||||
"vue": "^2.5.2",
|
||||
"vue-grid-layout": "^2.1.11",
|
||||
"vue-i18n": "^7.4.2",
|
||||
"vue-json-tree-view": "^2.1.4",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-splitpane": "^1.0.2",
|
||||
"vuex": "^3.0.1",
|
||||
"xlsx": "^0.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kazupon/vue-i18n-loader": "^0.2.1",
|
||||
"autoprefixer": "^7.1.2",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-eslint": "^7.1.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-runtime": "^6.22.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"babel-preset-stage-2": "^6.22.0",
|
||||
"chalk": "^2.0.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.28.0",
|
||||
"eslint": "^3.19.0",
|
||||
"eslint-config-standard": "^10.2.1",
|
||||
"eslint-friendly-formatter": "^3.0.0",
|
||||
"eslint-loader": "^1.7.1",
|
||||
"eslint-plugin-html": "^3.0.0",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
"eslint-plugin-node": "^5.2.0",
|
||||
"eslint-plugin-promise": "^3.4.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^1.1.4",
|
||||
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"less": "^3.0.4",
|
||||
"less-loader": "^4.1.0",
|
||||
"node-notifier": "^5.1.2",
|
||||
"node-sass": "^4.7.2",
|
||||
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||
"ora": "^1.2.0",
|
||||
"portfinder": "^1.0.13",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-loader": "^2.0.8",
|
||||
"rimraf": "^2.6.0",
|
||||
"sass-loader": "^6.0.6",
|
||||
"semver": "^5.5.0",
|
||||
"shelljs": "^0.7.6",
|
||||
"svg-sprite-loader": "^3.6.2",
|
||||
"text-loader": "0.0.1",
|
||||
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||
"url-loader": "^0.5.8",
|
||||
"vue-loader": "^13.3.0",
|
||||
"vue-style-loader": "^3.0.1",
|
||||
"vue-template-compiler": "^2.5.2",
|
||||
"webpack": "^3.6.0",
|
||||
"webpack-bundle-analyzer": "^2.9.0",
|
||||
"webpack-dev-server": "^2.9.1",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4.0.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
{
|
||||
// 一个新的页面
|
||||
"d2-new-page": {
|
||||
"prefix": "dd-new-page",
|
||||
"body": [
|
||||
"<template>",
|
||||
" <d2-container type=\"${1:full}\" class=\"page\">",
|
||||
" ${2:page-name}",
|
||||
" </d2-container>",
|
||||
"</template>",
|
||||
"",
|
||||
"<script>",
|
||||
"export default {",
|
||||
" data () {",
|
||||
" return {}",
|
||||
" },",
|
||||
" computed: {",
|
||||
" },",
|
||||
" methods: {",
|
||||
" }",
|
||||
"}",
|
||||
"</script>",
|
||||
"",
|
||||
"<style lang=\"scss\" scoped>",
|
||||
"@import '~@/assets/style/public.scss';",
|
||||
".page {",
|
||||
" // Your page style here",
|
||||
" // Do not use empty rulesets",
|
||||
" // If empty, delete it",
|
||||
"}",
|
||||
"</style>"
|
||||
],
|
||||
"description": "new page"
|
||||
},
|
||||
// d2-container 组件 header 插槽
|
||||
"d2-container-header": {
|
||||
"prefix": "dd-container-header",
|
||||
"body": [
|
||||
"<template slot=\"header\">${1:header}</template>"
|
||||
],
|
||||
"description": "d2-container component header slot"
|
||||
},
|
||||
// d2-container 组件 footer 插槽
|
||||
"d2-container-footer": {
|
||||
"prefix": "dd-container-footer",
|
||||
"body": [
|
||||
"<template slot=\"footer\">${1:footer}</template>"
|
||||
],
|
||||
"description": "d2-container component footer slot"
|
||||
},
|
||||
// 图标组件
|
||||
"d2-icon": {
|
||||
"prefix": "dd-icon",
|
||||
"body": [
|
||||
"<d2-icon name=\"${1:github}\"/>"
|
||||
],
|
||||
"description": "d2-icon component"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
{
|
||||
// 一个新的页面
|
||||
"d2-new-page": {
|
||||
"prefix": "dd-new-page",
|
||||
"body": [
|
||||
"<template>",
|
||||
" <d2-container type=\"${1:full}\" class=\"page\">",
|
||||
" ${2:page-name}",
|
||||
" </d2-container>",
|
||||
"</template>",
|
||||
"",
|
||||
"<script>",
|
||||
"export default {",
|
||||
" data () {",
|
||||
" return {}",
|
||||
" },",
|
||||
" computed: {",
|
||||
" },",
|
||||
" methods: {",
|
||||
" }",
|
||||
"}",
|
||||
"</script>",
|
||||
"",
|
||||
"<style lang=\"scss\" scoped>",
|
||||
"@import '~@/assets/style/public.scss';",
|
||||
".page {",
|
||||
" // Your page style here",
|
||||
" // Do not use empty rulesets",
|
||||
" // If empty, delete it",
|
||||
"}",
|
||||
"</style>"
|
||||
],
|
||||
"description": "new page"
|
||||
},
|
||||
// d2-container 组件 header 插槽
|
||||
"d2-container-header": {
|
||||
"prefix": "dd-container-header",
|
||||
"body": [
|
||||
"<template slot=\"header\">${1:header}</template>"
|
||||
],
|
||||
"description": "d2-container component header slot"
|
||||
},
|
||||
// d2-container 组件 footer 插槽
|
||||
"d2-container-footer": {
|
||||
"prefix": "dd-container-footer",
|
||||
"body": [
|
||||
"<template slot=\"footer\">${1:footer}</template>"
|
||||
],
|
||||
"description": "d2-container component footer slot"
|
||||
},
|
||||
// 图标组件
|
||||
"d2-icon": {
|
||||
"prefix": "dd-icon",
|
||||
"body": [
|
||||
"<d2-icon name=\"${1:github}\"/>"
|
||||
],
|
||||
"description": "d2-icon component"
|
||||
}
|
||||
}
|
||||
15
src/App.vue
|
|
@ -1,15 +0,0 @@
|
|||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'app'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '~@/assets/style/public-class.scss';
|
||||
</style>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import Vue from 'vue'
|
||||
|
||||
const requireAll = requireContext => requireContext.keys().map(requireContext)
|
||||
const req = require.context('./svg', false, /\.svg$/)
|
||||
const iconMap = requireAll(req)
|
||||
|
||||
Vue.prototype.$IconSvg = iconMap.map(e => e.default.id.slice(3))
|
||||
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M277.3 469.3m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#5F6379" /><path d="M344.7 978.2c-5.2 0-10.4-0.8-15.5-2.5-13.8-4.5-24.8-14.8-30.4-28.1l-39.3-94.2H128.3C57.5 853.3 0 795.8 0 725.1V213.6C0 142.9 57.5 85.3 128.3 85.3h767.5c70.7 0 128.3 57.5 128.3 128.3v511.5c0 70.7-57.5 128.3-128.3 128.3H566.5L370.2 971.1c-7.7 4.7-16.6 7.1-25.5 7.1z m-18.3-80.3s-0.1 0 0 0zM128.3 170.7c-23.7 0-42.9 19.3-42.9 42.9v511.5c0 23.7 19.3 42.9 42.9 42.9h188.2l45.3 108.7L542.9 768h352.9c23.7 0 42.9-19.3 42.9-42.9V213.6c0-23.7-19.3-42.9-42.9-42.9H128.3z" fill="#3688FF" /><path d="M512 469.3m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#5F6379" /><path d="M746.7 469.3m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#5F6379" /></svg>
|
||||
|
Before Width: | Height: | Size: 999 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M811.3 938.7H217.5c-71.5 0-129.8-58.2-129.8-129.8V215.1c0-71.6 58.2-129.8 129.8-129.8h296.9c23.6 0 42.7 19.1 42.7 42.7s-19.1 42.7-42.7 42.7H217.5c-24.5 0-44.4 19.9-44.4 44.4v593.8c0 24.5 19.9 44.4 44.4 44.4h593.8c24.5 0 44.4-19.9 44.4-44.4V512c0-23.6 19.1-42.7 42.7-42.7S941 488.4 941 512v296.9c0 71.6-58.2 129.8-129.7 129.8z" fill="#3688FF" /><path d="M898.4 405.3c-23.6 0-42.7-19.1-42.7-42.7V212.9c0-23.3-19-42.3-42.3-42.3H663.7c-23.6 0-42.7-19.1-42.7-42.7s19.1-42.7 42.7-42.7h149.7c70.4 0 127.6 57.2 127.6 127.6v149.7c0 23.7-19.1 42.8-42.6 42.8z" fill="#5F6379" /><path d="M373.6 712.6c-10.9 0-21.8-4.2-30.2-12.5-16.7-16.7-16.7-43.7 0-60.3L851.2 132c16.7-16.7 43.7-16.7 60.3 0 16.7 16.7 16.7 43.7 0 60.3L403.8 700.1c-8.4 8.3-19.3 12.5-30.2 12.5z" fill="#5F6379" /></svg>
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 1024C229.7 1024 0 794.3 0 512S229.7 0 512 0s512 229.7 512 512-229.7 512-512 512z m0-938.7C276.7 85.3 85.3 276.7 85.3 512S276.7 938.7 512 938.7 938.7 747.3 938.7 512 747.3 85.3 512 85.3z" fill="#3688FF" /><path d="M640 682.7c-9.6 0-19.3-3.2-27.3-9.9l-128-106.7c-9.7-8.1-15.4-20.1-15.4-32.8V384c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v129.4l112.6 93.9c18.1 15.1 20.5 42 5.5 60.1-8.5 10-20.6 15.3-32.8 15.3z" fill="#5F6379" /></svg>
|
||||
|
Before Width: | Height: | Size: 708 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="199.80px" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M512.8 977.4c-26.1 0-50.1-7.3-71.5-21.7C323.5 897 0 675.3 0 400.5 0 212 153.4 58.6 341.9 58.6c60.5 0 119 15.8 170.9 45.9 51.9-30.1 110.5-45.9 170.9-45.9 188.5 0 341.9 153.4 341.9 341.9 0 274.8-323.5 496.6-441.3 555.2-21.4 14.4-45.4 21.7-71.5 21.7zM341.9 144.1c-141.4 0-256.4 115-256.4 256.4 0 117.2 80.6 225.2 148.2 295.1 86.1 89 187.5 155.2 248.1 184.8l6.1 3.7c15.1 10.8 34.6 10.8 49.7 0l6.1-3.7C604.4 850.7 705.8 784.6 791.8 695.6c67.6-69.9 148.2-177.8 148.2-295.1 0-141.4-115-256.4-256.4-256.4-52.6 0-103.2 16-146.5 46.1L512.8 207.3l-24.5-17.1c-43.2-30.2-93.9-46.1-146.4-46.1z" /></svg>
|
||||
|
Before Width: | Height: | Size: 872 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 128c-23.6 0-42.7-19.1-42.7-42.7V42.7C469.3 19.1 488.4 0 512 0s42.7 19.1 42.7 42.7v42.7c0 23.5-19.1 42.6-42.7 42.6zM512 1024c-61.8 0-122.3-10.5-179.9-31.1-22.2-7.9-33.7-32.4-25.8-54.6 8-22.2 32.3-33.8 54.6-25.8 98.4 35.3 209.2 34.6 307.1-1.8 22.1-8.2 46.6 3 54.9 25.1 8.2 22.1-3 46.6-25.1 54.9-59.5 22.1-121.9 33.3-185.8 33.3z" fill="#5F6379" /><path d="M845 874.7H179c-75.2 0-136.4-61.2-136.4-136.4v-4.6c0-57.1 34.7-106 85.3-126.1V426.7c0-211.7 172.3-384 384-384s384 172.3 384 384v180.9c50.6 20.1 85.3 69 85.3 126.1v4.6c0.1 75.2-61 136.4-136.2 136.4zM512 128c-164.7 0-298.7 134-298.7 298.7v253.2l-38.9 3.5c-26.5 2.4-46.5 24-46.5 50.3v4.6c0 28.1 22.9 51 51 51h666c28.1 0 51-22.9 51-51v-4.6c0-26.3-20-48-46.5-50.3l-38.9-3.5V426.7C810.7 262 676.7 128 512 128z" fill="#3688FF" /></svg>
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M492.5 917.7c-247 0-447.9-200.9-447.9-447.9s200.9-448 447.9-448 447.9 200.9 447.9 447.9-200.9 448-447.9 448z m0-810.6c-200 0-362.6 162.7-362.6 362.6s162.7 362.6 362.6 362.6 362.6-162.7 362.6-362.6-162.6-362.6-362.6-362.6z" fill="#3688FF" /><path d="M951.1 971c-10.9 0-21.8-4.2-30.2-12.5l-96-96c-16.7-16.7-16.7-43.7 0-60.3 16.6-16.7 43.7-16.7 60.3 0l96 96c16.7 16.7 16.7 43.7 0 60.3-8.2 8.4-19.2 12.5-30.1 12.5z" fill="#5F6379" /></svg>
|
||||
|
Before Width: | Height: | Size: 702 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M761.2 942.8c-8.9 0-17.9-1.8-26.5-5.4l-220.7-93-220.7 93c-22.1 9.3-46.8 6.4-66.2-7.6-19.4-14.1-29.8-36.7-27.7-60.6l20.2-238.7L62.9 449.2c-15.7-18.1-20.6-42.5-13.2-65.3 7.4-22.8 25.7-39.6 49.1-45.1L332 284.3l123.9-205c12.4-20.5 34.1-32.7 58-32.7 24 0 45.7 12.2 58.1 32.7l123.9 205 233.2 54.5c23.3 5.5 41.7 22.3 49.1 45.1 7.4 22.8 2.5 47.2-13.2 65.3L808.4 630.4l20.2 238.7c2 23.9-8.3 46.5-27.7 60.6-11.8 8.6-25.7 13-39.7 13.1zM146.4 415.3L289 580.2c11.9 13.7 17.8 32 16.3 50.1l-18.4 217.2 200.8-84.6c16.8-7 35.9-7 52.6 0l200.9 84.6-18.4-217.2c-1.5-18.1 4.4-36.4 16.3-50.1l142.5-164.9-212.2-49.6c-17.7-4.1-33.2-15.4-42.6-31L514 148.3 401.2 334.8c-9.4 15.6-24.9 26.8-42.6 31l-212.2 49.5z m553.3-124.7h0.2-0.2z" /></svg>
|
||||
|
Before Width: | Height: | Size: 998 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 1024C229.7 1024 0 794.3 0 512S229.7 0 512 0s512 229.7 512 512-229.7 512-512 512z m0-938.7C276.7 85.3 85.3 276.7 85.3 512S276.7 938.7 512 938.7 938.7 747.3 938.7 512 747.3 85.3 512 85.3z" fill="#3688FF" /><path d="M682.7 554.7H341.3c-23.6 0-42.7-19.1-42.7-42.7s19.1-42.7 42.7-42.7h341.3c23.6 0 42.7 19.1 42.7 42.7s-19.1 42.7-42.6 42.7z" fill="#5F6379" /><path d="M512 725.3c-23.6 0-42.7-19.1-42.7-42.7V341.3c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v341.3c0 23.6-19.1 42.7-42.7 42.7z" fill="#5F6379" /></svg>
|
||||
|
Before Width: | Height: | Size: 784 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M192 938.7H87.9c-48.4 0-87.9-39.5-87.9-88V386.6c0-48.5 39.5-87.9 87.9-87.9h125.4c11.6 0 22.7 4.7 30.8 13.1 8 8.4 12.3 19.6 11.9 31.2l-21.3 554.7c-0.9 22.8-19.8 41-42.7 41zM87.9 384c-1.4 0-2.6 1.2-2.6 2.6v464.1c0 1.4 1.2 2.6 2.6 2.6h63L169 384H87.9z" fill="#5F6379" /><path d="M810.4 938.7H275.7l24.6-640H418l72-201.8C510.7 38.9 566 0 627.5 0c42.4 0 82.6 18.4 110.3 50.4S778 124.8 772 166.7l-18.9 132h142.6c70.7 0 128.2 57.5 128.2 128.2l-1 9.3-84.4 379.4c-2.6 68.3-59.1 123.1-128.1 123.1z m-446.1-85.4h446.1c23.6 0 42.9-19.2 42.9-42.9l1-9.3L938.5 423c-2-21.8-20.4-39-42.7-39h-241l32.8-229.4c2.5-17.7-2.5-34.8-14.2-48.3s-28-20.9-45.9-20.9c-25.6 0-48.5 16.2-57.1 40.3L478.1 384h-95.7l-18.1 469.3z" fill="#3688FF" /></svg>
|
||||
|
Before Width: | Height: | Size: 985 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 661.3c-117.6 0-213.3-95.7-213.3-213.3S394.4 234.7 512 234.7 725.3 330.4 725.3 448 629.6 661.3 512 661.3z m0-341.3c-70.6 0-128 57.4-128 128s57.4 128 128 128 128-57.4 128-128-57.4-128-128-128z" fill="#5F6379" /><path d="M837 862.9c-15.7 0-30.8-8.7-38.2-23.7C744.3 729.5 634.4 661.3 512 661.3s-232.3 68.1-286.8 177.9c-10.5 21.1-36.1 29.7-57.2 19.2s-29.7-36.1-19.2-57.2C217.8 662.3 357 576 512 576s294.2 86.3 363.2 225.2c10.5 21.1 1.9 46.7-19.2 57.2-6.1 3-12.6 4.5-19 4.5z" fill="#5F6379" /><path d="M512 1002.7c-270.6 0-490.7-220.1-490.7-490.7S241.4 21.3 512 21.3s490.7 220.1 490.7 490.7-220.1 490.7-490.7 490.7z m0-896c-223.5 0-405.3 181.8-405.3 405.3S288.5 917.3 512 917.3 917.3 735.5 917.3 512 735.5 106.7 512 106.7z" fill="#3688FF" /></svg>
|
||||
|
Before Width: | Height: | Size: 1013 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M899.9 938.7H124.1C55.7 938.7 0 883 0 814.6V273.4C0 205 55.7 149.3 124.1 149.3h68.7l85.3-106.7h467.7l85.3 106.7h68.7c68.4 0 124.1 55.7 124.1 124.1v541.1c0.1 68.5-55.6 124.2-124 124.2z m-775.8-704c-21.4 0-38.8 17.4-38.8 38.8v541.1c0 21.4 17.4 38.8 38.8 38.8h775.8c21.4 0 38.8-17.4 38.8-38.8V273.4c0-21.4-17.4-38.8-38.8-38.8H790.2L704.8 128H319.2l-85.3 106.7H124.1z" fill="#3688FF" /><path d="M512 768c-117.6 0-213.3-95.7-213.3-213.3S394.4 341.3 512 341.3 725.3 437 725.3 554.7 629.6 768 512 768z m0-341.3c-70.6 0-128 57.4-128 128s57.4 128 128 128 128-57.4 128-128-57.4-128-128-128z" fill="#5F6379" /><path d="M810.7 341.3m-42.7 0a42.7 42.7 0 1 0 85.4 0 42.7 42.7 0 1 0-85.4 0Z" fill="#5F6379" /></svg>
|
||||
|
Before Width: | Height: | Size: 967 B |
|
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 896c-223.5 0-405.3-181.8-405.3-405.3S288.5 85.3 512 85.3s405.3 181.8 405.3 405.3S735.5 896 512 896z m0-725.3c-176.4 0-320 143.5-320 320s143.6 320 320 320 320-143.5 320-320-143.6-320-320-320z" fill="#3688FF" /><path d="M922.6 249.6c-13.7 0-27.1-6.6-35.4-18.8-15.3-22.6-32.8-43.9-52.1-63.2-19.3-19.3-40.6-36.9-63.2-52.1-19.5-13.2-24.6-39.7-11.5-59.2 13.2-19.5 39.7-24.6 59.2-11.5 27.1 18.3 52.6 39.4 75.7 62.5s44.2 48.6 62.5 75.7c13.2 19.5 8.1 46.1-11.5 59.2-7.2 5-15.5 7.4-23.7 7.4zM101.4 249.6c-8.2 0-16.5-2.4-23.8-7.3-19.5-13.2-24.7-39.7-11.5-59.2 18.3-27.1 39.4-52.6 62.5-75.7s48.6-44.1 75.7-62.5c19.5-13.2 46.1-8 59.3 11.5 13.2 19.5 8.1 46-11.5 59.2-22.6 15.3-43.9 32.8-63.2 52.1-19.3 19.3-36.8 40.5-52.1 63.2-8.2 12.1-21.7 18.7-35.4 18.7zM138.6 970.7c-8.6 0-17.3-2.6-24.8-7.9-19.2-13.7-23.6-40.4-9.9-59.5l53.3-74.7c13.7-19.2 40.3-23.6 59.5-9.9 19.2 13.7 23.6 40.4 9.9 59.5l-53.3 74.7c-8.2 11.6-21.4 17.8-34.7 17.8zM885.4 970.7c-13.3 0-26.4-6.2-34.8-17.9l-53.3-74.7c-13.7-19.2-9.3-45.8 9.9-59.5 19.2-13.7 45.8-9.2 59.5 9.9l53.3 74.7c13.7 19.2 9.3 45.8-9.9 59.5-7.5 5.4-16.2 8-24.7 8zM512 554.7c-7.2 0-14.5-1.8-21-5.5-13.4-7.6-21.6-21.8-21.6-37.1V384c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v52.6l42.1-25.2c20.2-12.1 46.4-5.6 58.5 14.6 12.1 20.2 5.6 46.4-14.6 58.5l-106.7 64c-6.9 4.1-14.5 6.2-22.1 6.2z" fill="#5F6379" /></svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
|
|
@ -1 +0,0 @@
|
|||
822e9d488a148a997d7098a0608f482ab9f9fb7a
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project,
|
||||
Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome,
|
||||
comprehensive icon sets or copy and paste your own.
|
||||
|
||||
Please. Check it out.
|
||||
|
||||
-Dave Gandy
|
||||
|
|
@ -1 +0,0 @@
|
|||
ee906a8196d0fbd581c27a9d5615db4c250860f2
|
||||
|
|
@ -1 +0,0 @@
|
|||
540440ce89f2a408aa699b65100e18f15e0f09ca
|
||||
|
|
@ -1 +0,0 @@
|
|||
401ec0f36e4f73b8efa40bd6f604fe80d286db70
|
||||
|
|
@ -1 +0,0 @@
|
|||
e9f60ca953f93e35eab4108bd414bc02ddcf3928
|
||||
|
|
@ -1 +0,0 @@
|
|||
855c845e538b65548118279537a04eab2ec6ef0d
|
||||
|
|
@ -1 +0,0 @@
|
|||
35acda2fa1196aad98c2adf4378a7611dd713aa3
|
||||
|
|
@ -1 +0,0 @@
|
|||
400014a4b06eee3d0c0d54402a47ab2601b2862b
|
||||
|
|
@ -1 +0,0 @@
|
|||
4d13fc60404b91e398a37200c4a77b645cfd9586
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
// Animated Icons
|
||||
// --------------------------
|
||||
|
||||
.@{fa-css-prefix}-spin {
|
||||
-webkit-animation: fa-spin 2s infinite linear;
|
||||
animation: fa-spin 2s infinite linear;
|
||||
}
|
||||
|
||||
.@{fa-css-prefix}-pulse {
|
||||
-webkit-animation: fa-spin 1s infinite steps(8);
|
||||
animation: fa-spin 1s infinite steps(8);
|
||||
}
|
||||
|
||||
@-webkit-keyframes fa-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fa-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// Bordered & Pulled
|
||||
// -------------------------
|
||||
|
||||
.@{fa-css-prefix}-border {
|
||||
padding: .2em .25em .15em;
|
||||
border: solid .08em @fa-border-color;
|
||||
border-radius: .1em;
|
||||
}
|
||||
|
||||
.@{fa-css-prefix}-pull-left { float: left; }
|
||||
.@{fa-css-prefix}-pull-right { float: right; }
|
||||
|
||||
.@{fa-css-prefix} {
|
||||
&.@{fa-css-prefix}-pull-left { margin-right: .3em; }
|
||||
&.@{fa-css-prefix}-pull-right { margin-left: .3em; }
|
||||
}
|
||||
|
||||
/* Deprecated as of 4.4.0 */
|
||||
.pull-right { float: right; }
|
||||
.pull-left { float: left; }
|
||||
|
||||
.@{fa-css-prefix} {
|
||||
&.pull-left { margin-right: .3em; }
|
||||
&.pull-right { margin-left: .3em; }
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
// Base Class Definition
|
||||
// -------------------------
|
||||
|
||||
.@{fa-css-prefix} {
|
||||
display: inline-block;
|
||||
font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
|
||||
font-size: inherit; // can't have font-size inherit on line above, so need to override
|
||||
text-rendering: auto; // optimizelegibility throws things off #1094
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// Fixed Width Icons
|
||||
// -------------------------
|
||||
.@{fa-css-prefix}-fw {
|
||||
width: (18em / 14);
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
/*!
|
||||
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
|
||||
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
||||
*/
|
||||
|
||||
@import "variables.less";
|
||||
@import "mixins.less";
|
||||
@import "path.less";
|
||||
@import "core.less";
|
||||
@import "larger.less";
|
||||
@import "fixed-width.less";
|
||||
@import "list.less";
|
||||
@import "bordered-pulled.less";
|
||||
@import "animated.less";
|
||||
@import "rotated-flipped.less";
|
||||
@import "stacked.less";
|
||||
@import "icons.less";
|
||||
@import "screen-reader.less";
|
||||
|
|
@ -1 +0,0 @@
|
|||
159d600425c73c282be34f94af12179f091a16d2
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
// Icon Sizes
|
||||
// -------------------------
|
||||
|
||||
/* makes the font 33% larger relative to the icon container */
|
||||
.@{fa-css-prefix}-lg {
|
||||
font-size: (4em / 3);
|
||||
line-height: (3em / 4);
|
||||
vertical-align: -15%;
|
||||
}
|
||||
.@{fa-css-prefix}-2x { font-size: 2em; }
|
||||
.@{fa-css-prefix}-3x { font-size: 3em; }
|
||||
.@{fa-css-prefix}-4x { font-size: 4em; }
|
||||
.@{fa-css-prefix}-5x { font-size: 5em; }
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
// List Icons
|
||||
// -------------------------
|
||||
|
||||
.@{fa-css-prefix}-ul {
|
||||
padding-left: 0;
|
||||
margin-left: @fa-li-width;
|
||||
list-style-type: none;
|
||||
> li { position: relative; }
|
||||
}
|
||||
.@{fa-css-prefix}-li {
|
||||
position: absolute;
|
||||
left: -@fa-li-width;
|
||||
width: @fa-li-width;
|
||||
top: (2em / 14);
|
||||
text-align: center;
|
||||
&.@{fa-css-prefix}-lg {
|
||||
left: (-@fa-li-width + (4em / 14));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
// Mixins
|
||||
// --------------------------
|
||||
|
||||
.fa-icon() {
|
||||
display: inline-block;
|
||||
font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
|
||||
font-size: inherit; // can't have font-size inherit on line above, so need to override
|
||||
text-rendering: auto; // optimizelegibility throws things off #1094
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
}
|
||||
|
||||
.fa-icon-rotate(@degrees, @rotation) {
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})";
|
||||
-webkit-transform: rotate(@degrees);
|
||||
-ms-transform: rotate(@degrees);
|
||||
transform: rotate(@degrees);
|
||||
}
|
||||
|
||||
.fa-icon-flip(@horiz, @vert, @rotation) {
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)";
|
||||
-webkit-transform: scale(@horiz, @vert);
|
||||
-ms-transform: scale(@horiz, @vert);
|
||||
transform: scale(@horiz, @vert);
|
||||
}
|
||||
|
||||
|
||||
// Only display content to screen readers. A la Bootstrap 4.
|
||||
//
|
||||
// See: http://a11yproject.com/posts/how-to-hide-content/
|
||||
|
||||
.sr-only() {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0,0,0,0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
// Use in conjunction with .sr-only to only display content when it's focused.
|
||||
//
|
||||
// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
|
||||
//
|
||||
// Credit: HTML5 Boilerplate
|
||||
|
||||
.sr-only-focusable() {
|
||||
&:active,
|
||||
&:focus {
|
||||
position: static;
|
||||
width: auto;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
clip: auto;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
/* FONT PATH
|
||||
* -------------------------- */
|
||||
|
||||
@font-face {
|
||||
font-family: 'FontAwesome';
|
||||
src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}');
|
||||
src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'),
|
||||
url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'),
|
||||
url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'),
|
||||
url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'),
|
||||
url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg');
|
||||
// src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
// Rotated & Flipped Icons
|
||||
// -------------------------
|
||||
|
||||
.@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); }
|
||||
.@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); }
|
||||
.@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); }
|
||||
|
||||
.@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); }
|
||||
.@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); }
|
||||
|
||||
// Hook for IE8-9
|
||||
// -------------------------
|
||||
|
||||
:root .@{fa-css-prefix}-rotate-90,
|
||||
:root .@{fa-css-prefix}-rotate-180,
|
||||
:root .@{fa-css-prefix}-rotate-270,
|
||||
:root .@{fa-css-prefix}-flip-horizontal,
|
||||
:root .@{fa-css-prefix}-flip-vertical {
|
||||
filter: none;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// Screen Readers
|
||||
// -------------------------
|
||||
|
||||
.sr-only { .sr-only(); }
|
||||
.sr-only-focusable { .sr-only-focusable(); }
|
||||