diff --git a/packages/primevue/src/datatable/DataTable.vue b/packages/primevue/src/datatable/DataTable.vue index 5f46b988d..9b6f36460 100755 --- a/packages/primevue/src/datatable/DataTable.vue +++ b/packages/primevue/src/datatable/DataTable.vue @@ -297,6 +297,7 @@ import { getOuterHeight, getOuterWidth, isClickable, + isClient, removeClass, setAttribute } from '@primeuix/utils/dom'; @@ -442,7 +443,10 @@ export default { } }, mounted() { - this.$el.setAttribute(this.attributeSelector, ''); + if (isClient()) { + this.attributeSelector = UniqueComponentId(); + this.$el.setAttribute(this.attributeSelector, ''); + } if (this.isStateful()) { this.restoreState(); @@ -2031,9 +2035,6 @@ export default { return isNotEmpty(val) && this.selection && Array.isArray(this.selection) && val.every((v) => this.selection.some((s) => this.equals(s, v))); } }, - attributeSelector() { - return UniqueComponentId(); - }, groupRowSortField() { return this.sortMode === 'single' ? this.sortField : this.d_groupRowsSortMeta ? this.d_groupRowsSortMeta.field : null; },