naming of variables updated and redundancy created by use of the computed property is changed in sortBy method

This commit is contained in:
Sevan Nerse 2021-01-09 16:11:23 +03:00
parent e1cba9b339
commit ec8ad2d534
2 changed files with 10 additions and 10 deletions

View File

@ -383,15 +383,15 @@ export default {
methods: {
sortBy(option) {
return (a, b) => {
var nameA = a.[option].toUpperCase(); // ignore upper and lowercase
var nameB = b.[option].toUpperCase(); // ignore upper and lowercase
return (firstEl, secondEl) => {
let first_element = firstEl[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;
}
if (nameA > nameB) {
if (first_element > second_element) {
return 1;
}

View File

@ -450,15 +450,15 @@ export default {
methods: {
sortBy(option) {
return (a, b) => {
var nameA = a.[option].toUpperCase(); // ignore upper and lowercase
var nameB = b.[option].toUpperCase(); // ignore upper and lowercase
return (firstEl, secondEl) => {
let first_element = firstEl[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;
}
if (nameA > nameB) {
if (first_element > second_element) {
return 1;
}