Skip to content

Commit

Permalink
update date-fns package
Browse files Browse the repository at this point in the history
  • Loading branch information
xaksis committed Feb 28, 2021
1 parent 1426874 commit 378cfcc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
14 changes: 7 additions & 7 deletions 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 @@ -42,7 +42,7 @@
}
},
"dependencies": {
"date-fns": "^2.0.0-beta.4",
"date-fns": "^2.17.0",
"diacriticless": "1.0.1",
"lodash.isequal": "^4.5.0"
},
Expand Down
30 changes: 17 additions & 13 deletions src/components/VgtTableHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,23 +257,27 @@ export default {
mounted() {
this.$nextTick(() => {
// We're going to watch the parent element for resize events, and calculate column widths if it changes
this.ro = new ResizeObserver(() => {
this.setColumnStyles();
});
this.ro.observe(this.$parent.$el);
// If this is a fixed-header table, we want to observe each column header from the non-fixed header.
// You can imagine two columns swapping widths, which wouldn't cause the above to trigger.
// This gets the first tr element of the primary table header, and iterates through its children (the th elements)
if (this.tableRef) {
Array.from(this.$parent.$refs['table-header-primary'].$el.children[0].children).forEach((header) => {
this.ro.observe(header);
})
if (ResizeObserver) {
this.ro = new ResizeObserver(() => {
this.setColumnStyles();
});
this.ro.observe(this.$parent.$el);
// If this is a fixed-header table, we want to observe each column header from the non-fixed header.
// You can imagine two columns swapping widths, which wouldn't cause the above to trigger.
// This gets the first tr element of the primary table header, and iterates through its children (the th elements)
if (this.tableRef) {
Array.from(this.$parent.$refs['table-header-primary'].$el.children[0].children).forEach((header) => {
this.ro.observe(header);
})
}
}
});
},
beforeDestroy() {
this.ro.disconnect();
if (this.ro) {
this.ro.disconnect();
}
},
components: {
'vgt-filter-row': VgtFilterRow,
Expand Down
2 changes: 1 addition & 1 deletion vp-docs/guide/configuration/column-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type `String`
provide the format to parse date string.

::: tip
Vue-good-table uses date-fns for date parsing. [Check out their formats here](https://date-fns.org/v2.0.0-beta.4/docs/parse).
Vue-good-table uses date-fns for date parsing. [Check out their formats here](https://date-fns.org/v2.17.0/docs/parse).
:::

## dateOutputFormat
Expand Down

0 comments on commit 378cfcc

Please sign in to comment.