mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
docs(chip): update
This commit is contained in:
@@ -19,7 +19,7 @@ const items = [
|
||||
|
||||
const active = ref('0')
|
||||
|
||||
// Note: This is for demonstration purposes only.
|
||||
// Note: This is for demonstration purposes only. Don't do this at home.
|
||||
onMounted(() => {
|
||||
setInterval(() => {
|
||||
active.value = String((Number(active.value) + 1) % items.length)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
const statuses = ['online', 'offline', 'busy', 'away']
|
||||
const status = ref(statuses[0])
|
||||
|
||||
const color = computed(() => ({
|
||||
online: 'green',
|
||||
offline: 'gray',
|
||||
busy: 'red',
|
||||
away: 'amber'
|
||||
})[status.value] as any)
|
||||
const show = computed(() => status.value !== 'offline')
|
||||
|
||||
// Note: This is for demonstration purposes only. Don't do this at home.
|
||||
onMounted(() => {
|
||||
setInterval(() => {
|
||||
status.value = statuses[Math.floor(Math.random() * statuses.length)]
|
||||
}, 1000)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UChip :color="color" :show="show" inset>
|
||||
<UAvatar src="https://avatars.githubusercontent.com/u/739984?v=4" />
|
||||
</UChip>
|
||||
</template>
|
||||
@@ -10,7 +10,7 @@ const items = [
|
||||
|
||||
const active = ref('0')
|
||||
|
||||
// Note: This is for demonstration purposes only.
|
||||
// Note: This is for demonstration purposes only. Don't do this at home.
|
||||
onMounted(() => {
|
||||
setInterval(() => {
|
||||
active.value = String((Number(active.value) + 1) % items.length)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
const open = ref(true)
|
||||
|
||||
// Note: This is for demonstration purposes only.
|
||||
// Note: This is for demonstration purposes only. Don't do this at home.
|
||||
onMounted(() => {
|
||||
setInterval(() => {
|
||||
open.value = !open.value
|
||||
|
||||
Reference in New Issue
Block a user