Skip to content

Commit 5d54da5

Browse files
cargilltaymarcosmoura
authored andcommitted
fix(MdTable): undefined table sorting #1906 (#2012)
1 parent a275f18 commit 5d54da5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/MdTable/MdTable.vue

+8
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@
112112
const isAsc = this.MdTable.sortOrder === 'asc'
113113
let isNumber = typeof aAttr === 'number'
114114
115+
if (!aAttr) {
116+
return 1;
117+
}
118+
119+
if(!bAttr) {
120+
return -1
121+
}
122+
115123
if (isNumber) {
116124
return isAsc ? (aAttr - bAttr) : (bAttr - aAttr)
117125
}

0 commit comments

Comments
 (0)