Skip to content

Commit

Permalink
fix the sorting in vue3
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Cheng committed Oct 15, 2022
1 parent d49dfc6 commit b755a82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue3-excel-editor",
"email": "apple.6502@gmail.com",
"description": "Vue3 plugin for displaying and editing the array-of-object in Excel style",
"version": "1.0.14",
"version": "1.0.16",
"main": "src/main.js",
"dependencies": {
"@vuepic/vue-datepicker": "^3.3.0",
Expand Down
9 changes: 5 additions & 4 deletions src/VueExcelEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ondragover="event.preventDefault(); event.dataTransfer.dropEffect = 'none'">
<colgroup>
<col v-if="!noNumCol" style="width:40px">
<col v-for="(item, p) in fields" v-show="!item.invisible" :key="p" :style="{width: item.width, 'min-width': item.minWidth}">
<col v-for="(item, p) in fields" v-show="!item.invisible" :key="p" :style="{width: item.width}">
<col v-if="vScroller.buttonHeight < vScroller.height" style="width:12px">
</colgroup>
<thead class="center-text">
Expand Down Expand Up @@ -645,7 +645,7 @@ export default {
},
resetColumn () {
this.fields = []
this.$slots.default.forEach(col => col.componentInstance? col.componentInstance.init() : 0)
// this.$slots.default.forEach(col => col.componentInstance? col.componentInstance.init() : 0)
this.tableContent.scrollTo(0, this.tableContent.scrollTop)
this.calStickyLeft()
},
Expand Down Expand Up @@ -1047,7 +1047,7 @@ export default {
+ (this.noNumCol ? 0 : 40)
const fillWidth = viewWidth - fullWidth + 2
if (fillWidth)
doFields.forEach(f => f.minWidth = (f.width.replace(/px$/, '') - fillWidth / count) + 'px')
doFields.forEach(f => f.width = (f.width.replace(/px$/, '') - fillWidth / count) + 'px')
},
/* *** Date Picker *********************************************************************************
Expand Down Expand Up @@ -1666,7 +1666,8 @@ export default {
})
this.sortPos = colPos
this.sortDir = n
this.$forceUpdate()
this.refresh()
// this.$forceUpdate()
this.processing = false
}, 0)
},
Expand Down

0 comments on commit b755a82

Please sign in to comment.