From 0e8f95a0a1dbc4cf37f8f557a71528deacf64556 Mon Sep 17 00:00:00 2001 From: fofolee Date: Tue, 12 Apr 2022 00:58:33 +0800 Subject: [PATCH] quickcommand.updateSelectList --- src/components/quickcommandUI/SelectList.vue | 4 ++++ src/js/quickcommand.js | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/quickcommandUI/SelectList.vue b/src/components/quickcommandUI/SelectList.vue index aa38c77..5518aa7 100644 --- a/src/components/quickcommandUI/SelectList.vue +++ b/src/components/quickcommandUI/SelectList.vue @@ -75,6 +75,10 @@ export default { }, mounted() { window.SelectList = this; + quickcommand.updateSelectList = (opt, id) => { + if (typeof id === "undefined") this.items.push(opt); + else this.items[id] = opt; + }; this.options.enableSearch && this.setSubInput(); this.setUtoolsHeight(this.itemHeight * this.matchedItemsSize); }, diff --git a/src/js/quickcommand.js b/src/js/quickcommand.js index e145e04..0d835a7 100644 --- a/src/js/quickcommand.js +++ b/src/js/quickcommand.js @@ -112,11 +112,6 @@ const quickcommand = { console.log('取消') }) }), - - // 更新选项列表 - updateSelectList: () => { - - }, } export default quickcommand \ No newline at end of file