新增 window.temporaryStore

This commit is contained in:
fofolee
2022-04-12 10:54:35 +08:00
parent 8df2305879
commit a02392d7b5
7 changed files with 52 additions and 24 deletions

View File

@@ -60,7 +60,7 @@
</template>
<script>
import pinyinMatch from "pinyin-match"
import pinyinMatch from "pinyin-match";
export default {
data() {
@@ -77,7 +77,7 @@ export default {
},
mounted() {
window.SelectList = this;
quickcommand.updateSelectList = (opt, id) => {
window.temporaryStore.updateSelectList = (opt, id) => {
if (typeof id === "undefined") this.items.push(opt);
else this.items[id] = opt;
};
@@ -122,11 +122,11 @@ export default {
},
onDialogHide() {
this.clear();
this.$emit("hide");
},
onOKClick() {
utools.removeSubInput();
let selected =
this.options.optionType === "json"
? this.matchedItems[this.currentIndex]
@@ -139,8 +139,6 @@ export default {
},
onCancelClick() {
this.setUtoolsHeight(this.listMaxHeight);
utools.removeSubInput();
this.hide();
},
@@ -185,6 +183,12 @@ export default {
setUtoolsHeight(height) {
utools.setExpendHeight(Math.min(height, this.listMaxHeight));
},
clear() {
utools.removeSubInput();
this.setUtoolsHeight(this.listMaxHeight);
window.temporaryStoreSoldOut();
},
},
};
</script>