refactor: update to DevTools v1
This commit is contained in:
@ -1,14 +0,0 @@
|
||||
let _showNotification: typeof showNotification
|
||||
|
||||
export function showNotification(data: {
|
||||
message: string
|
||||
icon?: string
|
||||
classes?: string
|
||||
duration?: number
|
||||
}) {
|
||||
_showNotification?.(data)
|
||||
}
|
||||
|
||||
export function provideNotificationFn(fn: typeof showNotification) {
|
||||
_showNotification = fn
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
import { showNotification } from './dialog'
|
||||
// import { } from '@nuxt/devtools-ui-kit'
|
||||
|
||||
export function useCopy() {
|
||||
const clipboard = useClipboard()
|
||||
|
||||
return (text: string) => {
|
||||
clipboard.copy(text)
|
||||
showNotification({
|
||||
message: 'Copied to clipboard',
|
||||
icon: 'carbon-copy',
|
||||
})
|
||||
// devtoolsUiShowNotification({
|
||||
// message: 'Copied to clipboard',
|
||||
// icon: 'carbon-copy',
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user