Skip to content

Commit 24131f1

Browse files
authored
Refactor data list using VEntityContainer (#66)
Refactor data list using ⁠VEntityContainer to optimize display across devices of various sizes. See halo-dev/halo#7383 Note: Updating to this version requires Halo >= 2.21.0. ```release-note 适配 Halo 2.21.0 的数据列表样式 ```
1 parent bdd4687 commit 24131f1

File tree

4 files changed

+21
-25
lines changed

4 files changed

+21
-25
lines changed

app/src/main/resources/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
"store.halo.run/app-id": "app-KhIVw"
99
spec:
1010
enabled: true
11-
requires: ">=2.20.11"
11+
requires: ">=2.21.0"
1212
author:
1313
name: Halo
1414
website: https://github.com/halo-dev

ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@halo-dev/api-client": "^2.20.0",
13-
"@halo-dev/components": "^2.20.0",
13+
"@halo-dev/components": "https://pkg.pr.new/@halo-dev/components@7383",
1414
"@halo-dev/console-shared": "^2.20.0",
1515
"@tanstack/vue-query": "^4.37.1",
1616
"axios": "^1.7.9",

ui/pnpm-lock.yaml

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/components/SourcesTab.vue

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts" setup>
22
import { axiosInstance } from "@halo-dev/api-client";
3-
import { IconInformation, VEntity, VEntityField, VLoading } from "@halo-dev/components";
3+
import { IconInformation, VEntity, VEntityContainer, VEntityField, VLoading } from "@halo-dev/components";
44
import { useQuery } from "@tanstack/vue-query";
55
66
interface Source {
@@ -23,22 +23,17 @@ const { data, isLoading } = useQuery({
2323
<div class="m-4">
2424
<VLoading v-if="isLoading" />
2525
<div v-else class="overflow-hidden border rounded">
26-
<ul class="box-border h-full w-full divide-y divide-gray-100" role="list">
27-
<li v-for="source in data" :key="source.pattern">
28-
<VEntity class="group">
29-
<template #start>
30-
<VEntityField :title="source.displayName" :description="source.pattern">
31-
<template #extra>
32-
<IconInformation
33-
v-tooltip="source.description"
34-
class="hidden size-4 text-gray-600 group-hover:block"
35-
/>
36-
</template>
37-
</VEntityField>
38-
</template>
39-
</VEntity>
40-
</li>
41-
</ul>
26+
<VEntityContainer>
27+
<VEntity v-for="source in data" :key="source.pattern" class="group">
28+
<template #start>
29+
<VEntityField :title="source.displayName" :description="source.pattern">
30+
<template #extra>
31+
<IconInformation v-tooltip="source.description" class="hidden size-4 text-gray-600 group-hover:block" />
32+
</template>
33+
</VEntityField>
34+
</template>
35+
</VEntity>
36+
</VEntityContainer>
4237
</div>
4338
</div>
4439
</template>

0 commit comments

Comments
 (0)