From bf2629ffba83817e1e4cf121f6675121862fbd0e Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 23 Oct 2018 09:51:57 +0800 Subject: [PATCH 1/2] chore: restore the hack of cssnano bug https://github.com/cssnano/cssnano/issues/643 --- build/webpack.prod.conf.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 418d5d1d..946a134a 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -9,7 +9,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') -// const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') +const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') function resolve(dir) { @@ -140,7 +140,7 @@ const webpackConfig = merge(baseWebpackConfig, { }), // Compress extracted CSS. We are using this plugin so that possible // duplicated CSS from different components can be deduped. - // new OptimizeCSSAssetsPlugin() + new OptimizeCSSAssetsPlugin() ] } }) From ec58373a5283dab3c7c48eb387be5c4c8afa900f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Tue, 23 Oct 2018 17:04:25 +0800 Subject: [PATCH 2/2] add an example of sort data by table (#1236) --- src/views/table/complexTable.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/views/table/complexTable.vue b/src/views/table/complexTable.vue index cf7b5e4e..eb355e3b 100644 --- a/src/views/table/complexTable.vue +++ b/src/views/table/complexTable.vue @@ -24,8 +24,9 @@ border fit highlight-current-row - style="width: 100%;"> - + style="width: 100%;" + @sort-change="sortChange"> + @@ -233,6 +234,20 @@ export default { }) row.status = status }, + sortChange(data) { + const { prop, order } = data + if (prop === 'id') { + this.sortByID(order) + } + }, + sortByID(order) { + if (order === 'ascending') { + this.listQuery.sort = '+id' + } else { + this.listQuery.sort = '-id' + } + this.handleFilter() + }, resetTemp() { this.temp = { id: undefined,