精简全局变量

This commit is contained in:
fofolee
2022-04-12 08:51:09 +08:00
parent 0e8f95a0a1
commit 8df2305879
7 changed files with 84 additions and 211 deletions

View File

@@ -60,6 +60,8 @@
</template>
<script>
import pinyinMatch from "pinyin-match"
export default {
data() {
return {
@@ -86,7 +88,7 @@ export default {
matchedItems() {
let matchedItems = this.searchWords
? this.items.filter((x) =>
window.pinyinMatch(x.title ? x.title : x, this.searchWords)
pinyinMatch.match(x.title ? x.title : x, this.searchWords)
)
: this.items;
this.setUtoolsHeight(this.itemHeight * matchedItems.length);