Skip to content

Commit

Permalink
feat: Replace VButtons with dropdown for filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiHaosen committed Jul 17, 2024
1 parent 4aa7de4 commit 56b4e17
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ui/src/views/HtmlInjectionAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const submitForm = () => {
description: formData.value.description,
fragment: formData.value.fragment,
injectionPoint: formData.value.injectionPoint,
pageRules: formData.value.pageRules, // 转换为Set,符合HtmlInjection接口类型
pageRules: formData.value.pageRules,
enabled: formData.value.isEnabled,
},
};
Expand Down
23 changes: 18 additions & 5 deletions ui/src/views/HtmlInjectionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,24 @@ onMounted(fetchHtmlInjections);
<div class="flex w-full flex-1 sm:w-auto">
<SearchInput v-model="keyword" placeholder="请输入关键字" />
</div>
<div>
<VButton :class="{ active: activeTab === 'All' }" @click="activeTab = 'All'">全部</VButton>
<VButton :class="{ active: activeTab === 'Enabled' }" @click="activeTab = 'Enabled'">启用</VButton>
<VButton :class="{ active: activeTab === 'Disabled' }" @click="activeTab = 'Disabled'">禁用</VButton>
</div>
<FilterDropdown
v-model="activeTab"
:label="'状态'"
:items="[
{
label: '全部',
value: 'All',
},
{
label: '已启用',
value: 'Enabled',
},
{
label: '未启用',
value: 'Disabled',
},
]"
/>
</div>
</div>
</template>
Expand Down

0 comments on commit 56b4e17

Please sign in to comment.