mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 17:32:36 +00:00
Fixed #5046 - DataTable: Hydration attribute mismatch with sortable columns
This commit is contained in:
parent
088d3409de
commit
19cd180575
28 changed files with 42 additions and 55 deletions
|
@ -1,11 +1,16 @@
|
|||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
import BaseIconStyle from 'primevue/baseicon/style';
|
||||
import { ObjectUtils } from 'primevue/utils';
|
||||
import { ObjectUtils, UniqueComponentId } from 'primevue/utils';
|
||||
|
||||
export default {
|
||||
name: 'BaseIcon',
|
||||
extends: BaseComponent,
|
||||
data() {
|
||||
return {
|
||||
id: this.$attrs.id
|
||||
};
|
||||
},
|
||||
props: {
|
||||
label: {
|
||||
type: String,
|
||||
|
@ -17,6 +22,14 @@ export default {
|
|||
}
|
||||
},
|
||||
style: BaseIconStyle,
|
||||
mounted() {
|
||||
this.id = this.id || UniqueComponentId();
|
||||
},
|
||||
watch: {
|
||||
'$attrs.id': function (newValue) {
|
||||
this.id = newValue || UniqueComponentId();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pti() {
|
||||
const isLabelEmpty = ObjectUtils.isEmpty(this.label);
|
||||
|
@ -30,6 +43,7 @@ export default {
|
|||
}
|
||||
]
|
||||
}),
|
||||
id: this.id,
|
||||
role: !isLabelEmpty ? 'img' : undefined,
|
||||
'aria-label': !isLabelEmpty ? this.label : undefined,
|
||||
'aria-hidden': isLabelEmpty
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue