Skip to content

Commit 01a0d9e

Browse files
committed
Merge branch 'master' into deploy
2 parents 07cf479 + ec58373 commit 01a0d9e

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

build/webpack.prod.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
99
const HtmlWebpackPlugin = require('html-webpack-plugin')
1010
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
1111
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
12-
// const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
12+
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
1313
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
1414

1515
function resolve(dir) {
@@ -140,7 +140,7 @@ const webpackConfig = merge(baseWebpackConfig, {
140140
}),
141141
// Compress extracted CSS. We are using this plugin so that possible
142142
// duplicated CSS from different components can be deduped.
143-
// new OptimizeCSSAssetsPlugin()
143+
new OptimizeCSSAssetsPlugin()
144144
]
145145
}
146146
})

src/views/table/complexTable.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
border
2525
fit
2626
highlight-current-row
27-
style="width: 100%;">
28-
<el-table-column :label="$t('table.id')" align="center" width="65">
27+
style="width: 100%;"
28+
@sort-change="sortChange">
29+
<el-table-column :label="$t('table.id')" prop="id" sortable="custom" align="center" width="65">
2930
<template slot-scope="scope">
3031
<span>{{ scope.row.id }}</span>
3132
</template>
@@ -233,6 +234,20 @@ export default {
233234
})
234235
row.status = status
235236
},
237+
sortChange(data) {
238+
const { prop, order } = data
239+
if (prop === 'id') {
240+
this.sortByID(order)
241+
}
242+
},
243+
sortByID(order) {
244+
if (order === 'ascending') {
245+
this.listQuery.sort = '+id'
246+
} else {
247+
this.listQuery.sort = '-id'
248+
}
249+
this.handleFilter()
250+
},
236251
resetTemp() {
237252
this.temp = {
238253
id: undefined,

0 commit comments

Comments
 (0)