From 98b4f5bc1d99728b643e5894552ce76a4cdfc02d Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Wed, 21 Oct 2020 22:15:45 +0200 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bstar=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Star.vue | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/Star.vue b/src/components/Star.vue index e836d3b..73c7bc9 100644 --- a/src/components/Star.vue +++ b/src/components/Star.vue @@ -11,24 +11,30 @@ @@ -37,13 +43,11 @@ @@ -125,6 +129,20 @@ export default { }, methods: { ...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']), + sortByName (a, b) { + return a.name.localeCompare(b.name) + }, + sortByType (a, b) { + return a.type.localeCompare(b.type) + }, + sortBySite (a, b) { + const siteA = this.getSiteName(a.key) + if (!siteA) { + return -1 + } else { + return siteA.localeCompare(this.getSiteName(b.key)) + } + }, detailEvent (e) { this.detail = { show: true,