Skip to content

Commit b7f4d71

Browse files
committed
feat: add item size configuration options for list view in demo and documentation, enhancing user customization capabilities
1 parent 9d4d475 commit b7f4d71

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ gtag('config', 'G-6BYQESCJ6R');`
286286
items: [
287287
{ text: 'Basic Usage', link: '/examples/basic-usage' },
288288
{ text: 'Custom Icons', link: '/examples/custom-icons' },
289+
{ text: 'Item Size Configuration', link: '/examples/item-size-configuration' },
289290
{ text: 'Feature Presets', link: '/examples/feature-presets' },
290291
{ text: 'UI Visibility', link: '/examples/ui-visibility' },
291292
{ text: 'Single Selection', link: '/examples/single-selection' },

docs/.vitepress/theme/components/examples/ItemSizeConfigurationDemo.vue

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,49 @@
5858
</div>
5959
</div>
6060

61+
<div class="controls">
62+
<h4>List View Settings</h4>
63+
<div class="control-group">
64+
<label>
65+
<span>Item Height: {{ listItemHeight }}px</span>
66+
<input
67+
v-model.number="listItemHeight"
68+
type="range"
69+
min="20"
70+
max="80"
71+
step="2"
72+
class="slider"
73+
/>
74+
</label>
75+
</div>
76+
<div class="control-group">
77+
<label>
78+
<span>Gap: {{ listItemGap }}px</span>
79+
<input
80+
v-model.number="listItemGap"
81+
type="range"
82+
min="0"
83+
max="12"
84+
step="1"
85+
class="slider"
86+
/>
87+
</label>
88+
</div>
89+
<div class="control-group">
90+
<label>
91+
<span>Icon Size: {{ listIconSize }}px</span>
92+
<input
93+
v-model.number="listIconSize"
94+
type="range"
95+
min="16"
96+
max="40"
97+
step="2"
98+
class="slider"
99+
/>
100+
</label>
101+
</div>
102+
</div>
103+
61104
<div class="vuefinder-container">
62105
<vue-finder
63106
id="demo-item-size"
@@ -81,15 +124,20 @@ const gridItemWidth = ref(96);
81124
const gridItemHeight = ref(80);
82125
const gridItemGap = ref(8);
83126
const gridIconSize = ref(48);
127+
const listItemHeight = ref(32);
128+
const listItemGap = ref(2);
129+
const listIconSize = ref(20);
84130
85131
const computedConfig = computed(() => ({
86132
initialPath: 'local://',
87133
persist: false,
88-
view: 'grid',
89134
gridItemWidth: gridItemWidth.value,
90135
gridItemHeight: gridItemHeight.value,
91136
gridItemGap: gridItemGap.value,
92137
gridIconSize: gridIconSize.value,
138+
listItemHeight: listItemHeight.value,
139+
listItemGap: listItemGap.value,
140+
listIconSize: listIconSize.value,
93141
}));
94142
95143
const driver = ref<Driver | null>(null);

docs/examples/item-size-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Learn how to customize item dimensions, spacing, and icon sizes for both grid an
88

99
## Live Demo
1010

11-
Use the sliders below to adjust grid item dimensions and see the changes in real-time:
11+
Use the sliders below to adjust item dimensions and icon sizes for both grid and list views. Switch between grid and list view in the demo to see how icon sizes change:
1212

1313
<ClientOnly>
1414
<ItemSizeConfigurationDemo />

0 commit comments

Comments
 (0)