Skip to content

Commit fa46293

Browse files
author
Kenneth Cheng
committed
Fix the sorting bug
1 parent 2d163f0 commit fa46293

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vue3-excel-editor",
33
"email": "apple.6502@gmail.com",
44
"description": "Vue3 plugin for displaying and editing the array-of-object in Excel style",
5-
"version": "1.0.45",
5+
"version": "1.0.46",
66
"main": "src/main.js",
77
"dependencies": {
88
"@vuepic/vue-datepicker": "^3.3.0",

src/VueExcelColumn.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default {
3636
options: {type: [Array, Object, Function], default () {return null}},
3737
summary: {type: String, default: null},
3838
sort: {type: Function, default: null},
39+
sorting: {type: Function, default: null},
3940
masking: {type: String, default: ''},
4041
placeholder: {type: String, default: ''},
4142
color: {type: [String, Function], default: null},
@@ -252,6 +253,7 @@ export default {
252253
link: this.link,
253254
isLink: this.isLink || (this.link ? () => true : null),
254255
sort: this.sort,
256+
sorting: this.sorting,
255257
256258
keyField: this.keyField,
257259
sticky: this.sticky,

src/VueExcelEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,7 @@ export default defineComponent({
17241724
const name = field.name
17251725
setTimeout(() => {
17261726
let sorting = field.sorting
1727-
if (sorting === null) {
1727+
if (!sorting) {
17281728
if (field.type === 'number')
17291729
sorting = (a, b) => {
17301730
if (Number(a) > Number(b)) return 1

0 commit comments

Comments
 (0)