mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
feat(Alert/Toast)!: add orientation prop
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
const toast = useToast()
|
||||
|
||||
const props = defineProps<{
|
||||
orientation: 'horizontal' | 'vertical'
|
||||
}>()
|
||||
|
||||
function showToast() {
|
||||
toast.add({
|
||||
title: 'Uh oh! Something went wrong.',
|
||||
orientation: props.orientation,
|
||||
actions: [{
|
||||
icon: 'i-lucide-refresh-cw',
|
||||
label: 'Retry',
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
onClick: (e) => {
|
||||
e?.stopPropagation()
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UButton label="Show toast" color="neutral" variant="outline" @click="showToast" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user