feat: rewrite to use app config and rework docs (#143)

Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Sébastien Chopin <seb@nuxt.com>
This commit is contained in:
Benjamin Canac
2023-05-04 14:49:19 +02:00
committed by GitHub
parent 56230ea915
commit 6da0db0113
144 changed files with 10470 additions and 8109 deletions

View File

@@ -1,7 +1,8 @@
import { useClipboard } from '@vueuse/core'
import type { ToastNotification } from '../types/toast'
import { useToast } from './useToast'
export function useCopyToClipboard () {
export function useCopyToClipboard (options: Partial<ToastNotification> = {}) {
const { copy: copyToClipboard, isSupported } = useClipboard()
const toast = useToast()
@@ -15,11 +16,12 @@ export function useCopyToClipboard () {
return
}
toast.success(success)
toast.add({ ...success, ...options })
}, function (e) {
toast.error({
toast.add({
...failure,
description: failure.description || e.message
description: failure.description || e.message,
...options
})
})
}