失焦隐藏or不隐藏小按钮现在不会在搜索框出现,且切换到搜索框时一定会隐藏

This commit is contained in:
tcsnzh 2021-10-04 20:30:49 +08:00
parent 747c5512a7
commit ba45c627ab

View File

@ -59,14 +59,6 @@
</div> </div>
</div> </div>
</a-input> </a-input>
<span class="button-hide-on-blur" @click="changeHideOnBlur">
<a-icon
type="pushpin"
:style="{
color: config.perf.common.hideOnBlur ? 'grey' : '#ea68a2',
}"
></a-icon>
</span>
<div v-show="showOptions" class="options"> <div v-show="showOptions" class="options">
<a-list item-layout="horizontal" :data-source="options"> <a-list item-layout="horizontal" :data-source="options">
<a-list-item <a-list-item
@ -88,6 +80,18 @@
</a-list-item> </a-list-item>
</a-list> </a-list>
</div> </div>
<span
v-show="selected"
class="button-hide-on-blur"
@click="changeHideOnBlur"
>
<a-icon
type="pushpin"
:style="{
color: config.perf.common.hideOnBlur ? 'grey' : '#ea68a2',
}"
></a-icon>
</span>
</div> </div>
<div v-else class="rubick-select-subMenu"> <div v-else class="rubick-select-subMenu">
<div> <div>
@ -340,6 +344,7 @@ export default {
showMain: false, showMain: false,
options: [], options: [],
}); });
this.setHideOnBlur(true);
ipcRenderer.send("changeWindowSize-rubick", { ipcRenderer.send("changeWindowSize-rubick", {
height: getWindowHeight([]), height: getWindowHeight([]),
}); });
@ -411,6 +416,11 @@ export default {
cfg.perf.common.hideOnBlur = !cfg.perf.common.hideOnBlur; cfg.perf.common.hideOnBlur = !cfg.perf.common.hideOnBlur;
this.config = cfg; this.config = cfg;
}, },
setHideOnBlur(v) {
let cfg = { ...this.config };
cfg.perf.common.hideOnBlur = v;
this.config = cfg;
},
}, },
computed: { computed: {
...mapState("main", [ ...mapState("main", [