分享中心取消即时和拼音搜索

This commit is contained in:
fofolee 2022-04-16 09:48:27 +08:00
parent 807834244d
commit 3a7085ac31

View File

@ -96,11 +96,11 @@
debounce="200" debounce="200"
standout="bg-primary text-white" standout="bg-primary text-white"
dense dense
@update:model-value="updateSearch" @keydown="(e) => e.keyCode === 13 && updateSearch()"
placeholder="搜索,支持拼音首字母" placeholder="搜索"
> >
<template v-slot:prepend> <template v-slot:append>
<q-icon name="search" /> <q-btn dense flat icon="search" @click="updateSearch" />
</template> </template>
</q-input> </q-input>
</div> </div>
@ -119,7 +119,6 @@
<script> <script>
import commandTypes from "../js/options/commandTypes.js"; import commandTypes from "../js/options/commandTypes.js";
import pinyinMatch from "pinyin-match";
export default { export default {
data() { data() {
@ -194,7 +193,9 @@ export default {
if (!this.commandSearchKeyword) this.matchedCommands = this.allCommands; if (!this.commandSearchKeyword) this.matchedCommands = this.allCommands;
else else
this.matchedCommands = this.allCommands.filter((x) => this.matchedCommands = this.allCommands.filter((x) =>
pinyinMatch.match(x.title, this.commandSearchKeyword) x.title
.toLowerCase()
.includes(this.commandSearchKeyword.toLowerCase())
); );
this.fetchCommandDetails(1); this.fetchCommandDetails(1);
}, },