Play支持按拼音首字母搜索频道

This commit is contained in:
buvta
2020-11-21 13:38:03 +08:00
parent b8f010c4f5
commit f34da7ff85
2 changed files with 3 additions and 1 deletions

View File

@@ -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",

View File

@@ -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)