Skip to content

Commit

Permalink
fix(app): 修复软件浏览器标签输入时不自动提示的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Mar 24, 2023
1 parent f2f08e2 commit 6aececb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions packages/web/src/components/Tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@
placeholder="输入标签名"
size="small"
style="width: 100%"
:options="options"
:data="options"
@search="handleSearch"
>
<template #option="{ value, color, count }">
<template
#option="{
data: {
raw: { value, count, color }
}
}"
>
<a-tag :color="color"> {{ value }} </a-tag>
<span style="float: right"> {{ count }} </span>
</template>
Expand Down Expand Up @@ -114,7 +120,7 @@ const emits = defineEmits<{
const getOptions = () =>
object
.keys(store.render.browser.tags)
.map((key) => ({ value: key, ...store.render.browser.tags[key] }))
.map((key) => ({ value: key, label: key, ...store.render.browser.tags[key] }))
.sort((a, b) => b.count - a.count);
const options = ref(getOptions());
Expand All @@ -138,9 +144,10 @@ const handleClose = (removeTag: Tag) => {
const showModel = () => {
state.modalVisible = true;
nextTick(() => {
// 弹窗动作完成后,自动聚焦
setTimeout(() => {
inputRef.value.focus();
});
}, 300);
};
const handleInputConfirm = () => {
Expand Down

0 comments on commit 6aececb

Please sign in to comment.