Merge pull request #1 from PanJiaChen/master

从源更新
This commit is contained in:
lxzliuxinzhu 2017-07-03 10:31:13 +08:00 committed by GitHub
commit 8920f2150f
7 changed files with 85 additions and 83 deletions

8
.postcssrc.js Normal file
View File

@ -0,0 +1,8 @@
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
// to edit target browsers: use "browserlist" field in package.json
"autoprefixer": {}
}
}

View File

@ -3,69 +3,69 @@ var config = require('../config')
var ExtractTextPlugin = require('extract-text-webpack-plugin') var ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function (_path) { exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production' var assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory ? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory : config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path) return path.posix.join(assetsSubDirectory, _path)
} }
exports.cssLoaders = function (options) { exports.cssLoaders = function (options) {
options = options || {} options = options || {}
var cssLoader = { var cssLoader = {
loader: 'css-loader', loader: 'css-loader',
options: { options: {
minimize: process.env.NODE_ENV === 'production', minimize: process.env.NODE_ENV === 'production',
sourceMap: options.sourceMap sourceMap: options.sourceMap
} }
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
var loaders = [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
} }
// generate loader string to be used with extract text plugin // Extract CSS when that option is specified
function generateLoaders(loader, loaderOptions) { // (which is the case during production build)
var loaders = [cssLoader] if (options.extract) {
if (loader) { return ExtractTextPlugin.extract({
loaders.push({ use: loaders,
loader: loader + '-loader', fallback: 'vue-style-loader'
options: Object.assign({}, loaderOptions, { })
sourceMap: options.sourceMap } else {
}) return ['vue-style-loader'].concat(loaders)
})
}
// 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)
}
} }
}
// http://vuejs.github.io/vue-loader/en/configurations/extract-css.html // https://vue-loader.vuejs.org/en/configurations/extract-css.html
return { return {
css: generateLoaders(), css: generateLoaders(),
postcss: generateLoaders(), postcss: generateLoaders(),
less: generateLoaders('less'), less: generateLoaders('less'),
sass: generateLoaders('sass', {indentedSyntax: true}), sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'), scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'), stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus') styl: generateLoaders('stylus')
} }
} }
// Generate loaders for standalone style files (outside of .vue) // Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) { exports.styleLoaders = function (options) {
var output = [] var output = []
var loaders = exports.cssLoaders(options) var loaders = exports.cssLoaders(options)
for (var extension in loaders) { for (var extension in loaders) {
var loader = loaders[extension] var loader = loaders[extension]
output.push({ output.push({
test: new RegExp('\\.' + extension + '$'), test: new RegExp('\\.' + extension + '$'),
use: loader use: loader
}) })
} }
return output return output
} }

View File

@ -9,3 +9,7 @@
name: 'APP' name: 'APP'
} }
</script> </script>
<style lang="scss">
@import './styles/index.scss'; // css
</style>

View File

@ -6,11 +6,10 @@ import router from './router';
import store from './store'; import store from './store';
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import 'element-ui/lib/theme-default/index.css'; import 'element-ui/lib/theme-default/index.css';
import 'assets/custom-theme/index.css'; // 换肤版本element-ui css https://github.com/PanJiaChen/custom-element-theme import 'assets/custom-theme/index.css'; // 换肤版本element-ui css
import NProgress from 'nprogress'; // Progress 进度条 import NProgress from 'nprogress'; // Progress 进度条
import 'nprogress/nprogress.css';// Progress 进度条 样式 import 'nprogress/nprogress.css';// Progress 进度条 样式
import 'normalize.css/normalize.css';// normalize.css 样式格式化 import 'normalize.css/normalize.css';// normalize.css 样式格式化
import 'styles/index.scss'; // 全局自定义的css样式
import 'components/Icon-svg/index'; // 封装的svg组件 import 'components/Icon-svg/index'; // 封装的svg组件
import 'assets/iconfont/iconfont'; // iconfont 具体图标见https://github.com/PanJiaChen/vue-element-admin/wiki import 'assets/iconfont/iconfont'; // iconfont 具体图标见https://github.com/PanJiaChen/vue-element-admin/wiki
import * as filters from './filters'; // 全局vue filter import * as filters from './filters'; // 全局vue filter

View File

@ -1,6 +1,6 @@
@import './btn.scss'; @import './btn.scss';
@import './element-ui.scss'; @import './element-ui.scss';
@import "./mixin.scss"; @import './mixin.scss';
body { body {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
@ -108,7 +108,6 @@ code {
margin-top: 30px; margin-top: 30px;
} }
.editor-container .CodeMirror { .editor-container .CodeMirror {
height: 100%!important; height: 100%!important;
} }

View File

@ -13,7 +13,7 @@
<el-table-column prop="name" label="fruitName" width="180"></el-table-column> <el-table-column prop="name" label="fruitName" width="180"></el-table-column>
<el-table-column :key='fruit' v-for='(fruit,index) in formThead' :label="fruit"> <el-table-column :key='fruit' v-for='(fruit,index) in formThead' :label="fruit">
<template scope="scope"> <template scope="scope">
{{scope.row.list[index].value}} {{scope.row[fruit]}}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -28,20 +28,16 @@
return { return {
tableData: [ tableData: [
{ {
name: 'fruit1', name: 'fruit-1',
list: [ apple: 'apple-10',
{ name: 'apple1', value: 10 }, banana: 'banana-10',
{ name: 'banana1', value: 20 }, orange: 'orange-10'
{ name: 'orange1', value: 20 }
]
}, },
{ {
name: 'fruit2', name: 'fruit-2',
list: [ apple: 'apple-20',
{ name: 'apple2', value: 12 }, banana: 'banana-20',
{ name: 'banana2', value: 22 }, orange: 'orange-20'
{ name: 'orange2', value: 20 }
]
} }
], ],
key: 1, // table key key: 1, // table key

View File

@ -14,7 +14,7 @@
</el-table-column> </el-table-column>
<el-table-column :key='fruit' v-for='(fruit,index) in formThead' :label="fruit"> <el-table-column :key='fruit' v-for='(fruit,index) in formThead' :label="fruit">
<template scope="scope"> <template scope="scope">
{{scope.row.list[index].value}} {{scope.row[fruit]}}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -28,20 +28,16 @@
return { return {
tableData: [ tableData: [
{ {
name: 'fruit1', name: 'fruit-1',
list: [ apple: 'apple-10',
{ name: 'apple1', value: 10 }, banana: 'banana-10',
{ name: 'banana1', value: 20 }, orange: 'orange-10'
{ name: 'orange1', value: 20 }
]
}, },
{ {
name: 'fruit2', name: 'fruit-2',
list: [ apple: 'apple-20',
{ name: 'apple2', value: 12 }, banana: 'banana-20',
{ name: 'banana2', value: 22 }, orange: 'orange-20'
{ name: 'orange2', value: 20 }
]
} }
], ],
formThead: ['apple', 'banana'] formThead: ['apple', 'banana']