精简全局变量

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

View File

@@ -201,6 +201,7 @@ import CommandCard from "components/CommandCard";
import ConfigurationMenu from "components/ConfigurationMenu.vue";
import CommandRunResult from "components/CommandRunResult.vue";
import importAll from "../js/common/importAll.js";
import pinyinMatch from "pinyin-match";
const CommandEditor = defineAsyncComponent(() =>
import("components/CommandEditor.vue")
@@ -262,7 +263,7 @@ export default {
commands.forEach((cmd) => {
// 拼音搜索
let explain = cmd.features.explain;
let matchedWordPositions = window.pinyinMatch(
let matchedWordPositions = pinyinMatch.match(
explain,
this.commandSearchKeyword
);