Skip to content

Commit

Permalink
chore(VSelect): clean-up docs page and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Mar 10, 2025
1 parent 183cbd4 commit 48bf7ae
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 45 deletions.
6 changes: 3 additions & 3 deletions packages/docs/src/examples/v-select/prop-chips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
</template>

<script setup>
import { ref } from 'vue'
import { shallowRef } from 'vue'
const items = ref(['foo', 'bar', 'fizz', 'buzz'])
const value = ref(['foo', 'bar', 'fizz', 'buzz'])
const items = shallowRef(['foo', 'bar', 'fizz', 'buzz'])
const value = shallowRef(['foo', 'bar', 'fizz', 'buzz'])
</script>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</template>

<script setup>
import { ref } from 'vue'
import { shallowRef } from 'vue'
const select = ref({ state: 'Florida', abbr: 'FL' })
const select = shallowRef({ state: 'Florida', abbr: 'FL' })
const items = [
{ state: 'Florida', abbr: 'FL' },
Expand Down
30 changes: 14 additions & 16 deletions packages/docs/src/examples/v-select/prop-dense.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<template>
<div>
<v-select
:items="items"
density="compact"
label="Compact"
></v-select>
<v-select
:items="items"
density="compact"
label="Compact"
></v-select>

<v-select
:items="items"
density="comfortable"
label="Comfortable"
></v-select>
<v-select
:items="items"
density="comfortable"
label="Comfortable"
></v-select>

<v-select
:items="items"
label="Default"
></v-select>
</div>
<v-select
:items="items"
label="Default"
></v-select>
</template>

<script setup>
Expand Down
6 changes: 5 additions & 1 deletion packages/docs/src/examples/v-select/prop-item-props.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<v-select :item-props="itemProps" :items="items" label="User"></v-select>
<v-select
:item-props="itemProps"
:items="items"
label="User"
></v-select>
</template>

<script setup>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/examples/v-select/prop-menu-props.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-select
:items="items"
:menu-props="{ top: true, offsetY: true }"
:menu-props="{ scrim: true, scrollStrategy: 'close' }"
label="Label"
></v-select>
</template>
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/examples/v-select/prop-multiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</template>

<script setup>
import { ref } from 'vue'
import { shallowRef } from 'vue'
const favorites = ref([])
const favorites = shallowRef([])
const states = [
'Alabama',
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/examples/v-select/prop-readonly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
</template>

<script setup>
import { ref } from 'vue'
import { shallowRef } from 'vue'
const model = shallowRef('Foo')
const items = ['Foo', 'Bar', 'Fizz', 'Buzz']
const model = ref('Foo')
</script>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</template>

<script setup>
import { computed, ref } from 'vue'
import { computed, shallowRef } from 'vue'
const fruits = [
'Apples',
Expand Down Expand Up @@ -90,7 +90,7 @@
'Zucchini',
]
const selectedFruits = ref([])
const selectedFruits = shallowRef([])
const likesAllFruit = computed(() => {
return selectedFruits.value.length === fruits.length
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/examples/v-select/slot-item.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-select :items="items" item-title="name" label="User">
<template v-slot:item="{ props, item }">
<v-list-item v-bind="props" :subtitle="item.raw.department"></v-list-item>
<template v-slot:item="{ props: itemProps, item }">
<v-list-item v-bind="itemProps" :subtitle="item.raw.department"></v-list-item>
</template>
</v-select>
</template>
Expand Down
12 changes: 5 additions & 7 deletions packages/docs/src/examples/v-select/slot-selection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
multiple
>
<template v-slot:selection="{ item, index }">
<v-chip v-if="index < 2">
<span>{{ item.title }}</span>
</v-chip>
<v-chip v-if="index < 2" :text="item.title"></v-chip>

<span
v-if="index === 2"
class="text-grey text-caption align-self-center"
Expand All @@ -20,18 +19,17 @@
</template>

<script setup>
import { ref } from 'vue'
import { shallowRef } from 'vue'
const value = shallowRef(['foo', 'bar', 'fizz'])
const items = ['foo', 'bar', 'fizz', 'buzz', 'fizzbuzz', 'foobar']
const value = ref(['foo', 'bar', 'fizz'])
</script>

<script>
export default {
data: () => ({
items: ['foo', 'bar', 'fizz', 'buzz', 'fizzbuzz', 'foobar'],
value: ['foo', 'bar', 'fizz'],
items: ['foo', 'bar', 'fizz', 'buzz', 'fizzbuzz', 'foobar'],
}),
}
</script>
8 changes: 4 additions & 4 deletions packages/docs/src/examples/v-select/usage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

<script setup>
const name = 'v-select'
const model = ref('default')
const clear = ref(false)
const chips = ref(false)
const multiple = ref(false)
const model = shallowRef('default')
const clear = shallowRef(false)
const chips = shallowRef(false)
const multiple = shallowRef(false)
const options = ['outlined', 'underlined', 'solo', 'solo-filled', 'solo-inverted']
const props = computed(() => {
return {
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/src/pages/en/components/selects.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ You can specify the specific properties within your items array that correspond

<ExamplesExample file="v-select/prop-custom-title-and-value" />

<!-- #### Menu props
#### Menu props

Custom props can be passed directly to `v-menu` using **menuProps** prop. In this example menu is force directed to top and shifted to top.
Custom props can be passed directly to `v-menu` using **menu-props** prop. In this example a scrim as added to the select and the menu closes when you scroll.

<ExamplesExample file="v-select/prop-menu-props" /> -->
<ExamplesExample file="v-select/prop-menu-props" />

#### Custom item props

Expand Down

0 comments on commit 48bf7ae

Please sign in to comment.