From f34da7ff85963d10cc2db598ed1458a80dccd4fc Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Sat, 21 Nov 2020 13:38:03 +0800 Subject: [PATCH] =?UTF-8?q?Play=E6=94=AF=E6=8C=81=E6=8C=89=E6=8B=BC?= =?UTF-8?q?=E9=9F=B3=E9=A6=96=E5=AD=97=E6=AF=8D=E6=90=9C=E7=B4=A2=E9=A2=91?= =?UTF-8?q?=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/components/Play.vue | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a80a76a..14d8037 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "memcached": "^2.2.2", "modern-normalize": "^1.0.0", "mousetrap": "^1.6.5", + "pinyin-match": "^1.1.1", "qrcode.vue": "^1.7.0", "randomstring": "^1.1.5", "session": "^0.1.0", diff --git a/src/components/Play.vue b/src/components/Play.vue index d3d4533..1ad6c4c 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -230,6 +230,7 @@ import { directive as onClickaway } from 'vue-clickaway' import { exec, execFile } from 'child_process' const { remote, clipboard } = require('electron') +const PinyinMatch = require('pinyin-match') const VIDEO_DETAIL_CACHE = {} @@ -434,7 +435,7 @@ export default { }, filterNode (value, data) { if (!value) return true - return data.label.toLowerCase().includes(value.toLowerCase()) + return data.label.toLowerCase().includes(value.toLowerCase()) || PinyinMatch.match(data.label, value) }, querySearch (queryString, cb) { var searchRecordList = this.searchRecordList.slice(0, -1)