mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-22 16:00:39 +01:00
feat(module): devtools integration (#2196)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<!-- eslint-disable vue/block-tag-newline -->
|
||||
<script lang="ts">
|
||||
import { tv, type VariantProps } from 'tailwind-variants'
|
||||
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps } from 'radix-vue'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/context-menu'
|
||||
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
||||
import type { AvatarProps, KbdProps, LinkProps } from '../types'
|
||||
import type { DynamicSlots, PartialString } from '../types/utils'
|
||||
|
||||
@@ -79,6 +79,66 @@ export type ContextMenuSlots<T extends { slot?: string }> = {
|
||||
'item-trailing': SlotProps<T>
|
||||
} & DynamicSlots<T, SlotProps<T>>
|
||||
|
||||
extendDevtoolsMeta({
|
||||
example: 'ContextMenuExample',
|
||||
ignoreProps: ['items'],
|
||||
defaultProps: {
|
||||
items: [
|
||||
[{
|
||||
label: 'My account',
|
||||
avatar: {
|
||||
src: 'https://avatars.githubusercontent.com/u/739984?v=4'
|
||||
}
|
||||
}],
|
||||
[{
|
||||
label: 'Appearance',
|
||||
children: [{
|
||||
label: 'System',
|
||||
icon: 'i-heroicons-computer-desktop'
|
||||
}, {
|
||||
label: 'Light',
|
||||
icon: 'i-heroicons-sun'
|
||||
}, {
|
||||
label: 'Dark',
|
||||
icon: 'i-heroicons-moon'
|
||||
}]
|
||||
}],
|
||||
[{
|
||||
label: 'Show Sidebar',
|
||||
kbds: ['meta', 'S']
|
||||
}, {
|
||||
label: 'Show Toolbar',
|
||||
kbds: ['shift', 'meta', 'D']
|
||||
}, {
|
||||
label: 'Collapse Pinned Tabs',
|
||||
disabled: true
|
||||
}], [{
|
||||
label: 'Refresh the Page'
|
||||
}, {
|
||||
label: 'Clear Cookies and Refresh'
|
||||
}, {
|
||||
label: 'Clear Cache and Refresh'
|
||||
}, {
|
||||
type: 'separator'
|
||||
}, {
|
||||
label: 'Developer',
|
||||
children: [[{
|
||||
label: 'View Source',
|
||||
kbds: ['option', 'meta', 'U']
|
||||
}, {
|
||||
label: 'Developer Tools',
|
||||
kbds: ['option', 'meta', 'I']
|
||||
}], [{
|
||||
label: 'Inspect Elements',
|
||||
kbds: ['option', 'meta', 'C']
|
||||
}], [{
|
||||
label: 'JavaScript Console',
|
||||
kbds: ['option', 'meta', 'J']
|
||||
}]]
|
||||
}]
|
||||
]
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<script setup lang="ts" generic="T extends ContextMenuItem">
|
||||
|
||||
Reference in New Issue
Block a user