Skip to content

Commit f72c16b

Browse files
pdanpdanrstoenescu
authored andcommitted
fix(QTable): Only set length of rows if greater than the new length quasarframework#5816, quasarframework#5814 (quasarframework#5818)
1 parent 1955aa1 commit f72c16b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ui/dev/components/components/data-table-part2.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
:columns="columns"
110110
:filter="filter"
111111
:visible-columns="visibleColumns"
112+
no-data-label="I didn't find anything for you"
112113
row-key="name"
113114
color="primary"
114115
>
@@ -146,6 +147,15 @@
146147
</q-menu>
147148
</q-btn>
148149
</template>
150+
151+
<template v-slot:no-data="props">
152+
<q-banner class="full-width bg-warning">
153+
<template v-slot:avatar>
154+
<q-icon :name="props.icon" color="primary" />
155+
</template>
156+
{{ props.message }}
157+
</q-banner>
158+
</template>
149159
</q-table>
150160

151161
<h4>Custom header/body</h4>

ui/src/components/table/QTable.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ export default Vue.extend({
167167

168168
if (rowsPerPage !== 0) {
169169
if (this.firstRowIndex === 0 && this.data !== rows) {
170-
rows.length = this.lastRowIndex
170+
if (rows.length > this.lastRowIndex) {
171+
rows.length = this.lastRowIndex
172+
}
171173
}
172174
else {
173175
rows = rows.slice(this.firstRowIndex, this.lastRowIndex)

0 commit comments

Comments
 (0)