- {{ model?.current?.label }} ​
+ {{ currentItem?.label }} {{ `​${''}` }}
@@ -268,12 +274,13 @@ const current = computed(() => (
diff --git a/front/src/components/ui/Pills.vue b/front/src/components/ui/Pills.vue
index 935e6fcbe..0a07b6977 100644
--- a/front/src/components/ui/Pills.vue
+++ b/front/src/components/ui/Pills.vue
@@ -1,27 +1,23 @@
@@ -94,8 +63,6 @@ watch( model, () => {
:class="$style.label"
>
{{ props.label }}
- PILLS {{ pills.map(({ current })=>current.label) }}
- MODEL {{ model.currents.map(({ label })=>label) }}
@@ -107,19 +74,46 @@ watch( model, () => {
:class="$style.list"
>
{ console.log('CCCCCC', index); changed(index, pill) }"
+ :class="[$style.pill, $style[
+ isStatic
+ ? 'static'
+ : model.currents[index].label === ''
+ ? 'empty'
+ : model.currents[index].type
+ ]]"
+ @closed="() => { sanitize() }"
+ @confirmed="() => { next(index) }"
>
{{ pill.current.label }}
- {{ `${index} ${componentKey}` }}
+ >{{ model.currents[index].label }}
+
+
diff --git a/front/ui-docs/components/ui/pill.md b/front/ui-docs/components/ui/pill.md
index b2b0f8d94..7a79e5016 100644
--- a/front/ui-docs/components/ui/pill.md
+++ b/front/ui-docs/components/ui/pill.md
@@ -4,14 +4,12 @@ import { computed, ref } from 'vue'
import Pill from '~/components/ui/Pill.vue'
import Button from '~/components/ui/Button.vue'
-const customTag = ref({
- current: { type: 'custom', label: 'I-am-custom.-Change-me!' },
- others: [
+const current = ref({ type: 'custom', label: 'I-am-custom.-Change-me!' })
+const others = ref([
{ type: 'preset', label: 'Preset-1' },
{ type: 'preset', label: 'Preset-2' },
{ type: 'preset', label: 'Preset-3' },
- ]
-})
+ ])
```ts
@@ -170,28 +168,35 @@ Add `v-model="..."` to link the pill content to a `ref` with one `current` item
```ts
import { ref } from "vue"
-const customTag = ref({
- current: { type: 'custom', label: 'I-am-custom.-Change-me!' },
- others: [
+const current = ref({ type: 'custom', label: 'I-am-custom.-Change-me!' })
+const others = ref([
{ type: 'preset', label: 'Preset-1' },
{ type: 'preset', label: 'Preset-2' },
{ type: 'preset', label: 'Preset-3' },
- ]
-})
+ ])
```
```vue-html
-
+
```
-
+
## Add an action
```vue-html
-
+