Skip to content

Commit b755a82

Browse files
author
Kenneth Cheng
committed
fix the sorting in vue3
1 parent d49dfc6 commit b755a82

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
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.14",
5+
"version": "1.0.16",
66
"main": "src/main.js",
77
"dependencies": {
88
"@vuepic/vue-datepicker": "^3.3.0",

src/VueExcelEditor.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
ondragover="event.preventDefault(); event.dataTransfer.dropEffect = 'none'">
2424
<colgroup>
2525
<col v-if="!noNumCol" style="width:40px">
26-
<col v-for="(item, p) in fields" v-show="!item.invisible" :key="p" :style="{width: item.width, 'min-width': item.minWidth}">
26+
<col v-for="(item, p) in fields" v-show="!item.invisible" :key="p" :style="{width: item.width}">
2727
<col v-if="vScroller.buttonHeight < vScroller.height" style="width:12px">
2828
</colgroup>
2929
<thead class="center-text">
@@ -645,7 +645,7 @@ export default {
645645
},
646646
resetColumn () {
647647
this.fields = []
648-
this.$slots.default.forEach(col => col.componentInstance? col.componentInstance.init() : 0)
648+
// this.$slots.default.forEach(col => col.componentInstance? col.componentInstance.init() : 0)
649649
this.tableContent.scrollTo(0, this.tableContent.scrollTop)
650650
this.calStickyLeft()
651651
},
@@ -1047,7 +1047,7 @@ export default {
10471047
+ (this.noNumCol ? 0 : 40)
10481048
const fillWidth = viewWidth - fullWidth + 2
10491049
if (fillWidth)
1050-
doFields.forEach(f => f.minWidth = (f.width.replace(/px$/, '') - fillWidth / count) + 'px')
1050+
doFields.forEach(f => f.width = (f.width.replace(/px$/, '') - fillWidth / count) + 'px')
10511051
},
10521052
10531053
/* *** Date Picker *********************************************************************************
@@ -1666,7 +1666,8 @@ export default {
16661666
})
16671667
this.sortPos = colPos
16681668
this.sortDir = n
1669-
this.$forceUpdate()
1669+
this.refresh()
1670+
// this.$forceUpdate()
16701671
this.processing = false
16711672
}, 0)
16721673
},

0 commit comments

Comments
 (0)