funkwhale/front/ui-docs/components/ui/pills.md

58 wiersze
1.2 KiB
Markdown
Czysty Zwykły widok Historia

2025-01-04 11:01:02 +00:00
<script setup>
import { computed, ref } from 'vue'
import Pills from '~/components/ui/Pills.vue';
import Layout from '~/components/ui/Layout.vue';
import Input from '~/components/ui/Input.vue';
const nullModel = ref({
current: [],
others: []
});
2025-01-04 11:01:02 +00:00
const staticModel = ref({
current: ["#Noise", "#FieldRecording", "#Experiment"]
2025-01-04 11:01:02 +00:00
});
const interactiveModel = ref({
current: ["#Noise", "#FieldRecording", "#Experiment"],
others: ["#Melody", "#Rhythm"]
2025-01-04 11:01:02 +00:00
});
</script>
```ts
import Pills from "~/components/ui/Pills.vue"
```
2025-01-04 11:01:02 +00:00
# Pills
```vue-html
<Pills v-model="staticModel" label="Tags" />
```
2025-01-04 11:01:02 +00:00
<Layout class="preview" style="padding:16px">
<Pills v-model="staticModel" label="Tags" />
</Layout>
Select a set of pills from presets, and add and remove custom ones
```vue-html
<Pills v-model="interactiveModel" label="Tags" />
<Input label="Label" placeholder="Placeholder"></Input>
```
2025-01-04 11:01:02 +00:00
<Layout class="preview" style="padding:16px">
<Pills v-model="interactiveModel" label="Tags" />
<Input label="Label" placeholder="Placeholder"></Input>
</Layout>
## No pills
```vue-html
<Pills v-model="nullModel" />
```
<Layout class="preview" style="padding:16px">
<Pills v-model="nullModel" />
2025-01-04 11:01:02 +00:00
</Layout>