naming of variables updated and redundancy created by use of the computed property is changed in sortBy method
This commit is contained in:
parent
e1cba9b339
commit
ec8ad2d534
@ -383,15 +383,15 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
sortBy(option) {
|
sortBy(option) {
|
||||||
return (a, b) => {
|
return (firstEl, secondEl) => {
|
||||||
var nameA = a.[option].toUpperCase(); // ignore upper and lowercase
|
let first_element = firstEl[option].toUpperCase(); // ignore upper and lowercase
|
||||||
var nameB = b.[option].toUpperCase(); // ignore upper and lowercase
|
let second_element = secondEl[option].toUpperCase(); // ignore upper and lowercase
|
||||||
|
|
||||||
if (nameA < nameB) {
|
if (first_element < second_element) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nameA > nameB) {
|
if (first_element > second_element) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,15 +450,15 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
sortBy(option) {
|
sortBy(option) {
|
||||||
return (a, b) => {
|
return (firstEl, secondEl) => {
|
||||||
var nameA = a.[option].toUpperCase(); // ignore upper and lowercase
|
let first_element = firstEl[option].toUpperCase(); // ignore upper and lowercase
|
||||||
var nameB = b.[option].toUpperCase(); // ignore upper and lowercase
|
let second_element = secondEl[option].toUpperCase(); // ignore upper and lowercase
|
||||||
|
|
||||||
if (nameA < nameB) {
|
if (first_element < second_element) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nameA > nameB) {
|
if (first_element > second_element) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user