Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
cb993a64
Commit
cb993a64
authored
Oct 18, 2017
by
lirilsu
Committed by
杨奕
Oct 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Table: Change sort method to match built-in Array#sort
parent
fa140dea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
packages/table/src/util.js
packages/table/src/util.js
+2
-1
No files found.
packages/table/src/util.js
View file @
cb993a64
...
@@ -28,7 +28,8 @@ export const orderBy = function(array, sortKey, reverse, sortMethod) {
...
@@ -28,7 +28,8 @@ export const orderBy = function(array, sortKey, reverse, sortMethod) {
// sort on a copy to avoid mutating original array
// sort on a copy to avoid mutating original array
return
array
.
slice
().
sort
(
sortMethod
?
function
(
a
,
b
)
{
return
array
.
slice
().
sort
(
sortMethod
?
function
(
a
,
b
)
{
return
sortMethod
(
a
,
b
)
?
order
:
-
order
;
const
result
=
sortMethod
(
a
,
b
);
return
result
===
0
?
0
:
result
>
0
?
order
:
-
order
;
}
:
function
(
a
,
b
)
{
}
:
function
(
a
,
b
)
{
if
(
sortKey
!==
'
$key
'
)
{
if
(
sortKey
!==
'
$key
'
)
{
if
(
isObject
(
a
)
&&
'
$value
'
in
a
)
a
=
a
.
$value
;
if
(
isObject
(
a
)
&&
'
$value
'
in
a
)
a
=
a
.
$value
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment