mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-26 01:34:07 +00:00
## Summary Adds the [tailwind lint plugin](https://github.com/francoismassart/eslint-plugin-tailwindcss/?tab=readme-ov-file#eslint-plugin-tailwindcss) and fixes the currently fixable rules ([v4 is still in beta](https://github.com/francoismassart/eslint-plugin-tailwindcss/?tab=readme-ov-file#about-tailwind-css-4-support)). ## Changes - **What**: Enforces things like consistent class order, and eventually can prohibit extra classes that could be utilities instead - **Dependencies**: The plugin and its types ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5984-Lint-Add-tailwind-linter-2866d73d365081d89db0d998232533bb) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
60 lines
1.5 KiB
Vue
60 lines
1.5 KiB
Vue
<template>
|
|
<div
|
|
v-if="option.type === 'divider'"
|
|
class="my-1 h-px bg-gray-200 dark-theme:bg-zinc-700"
|
|
/>
|
|
<div
|
|
v-else
|
|
role="button"
|
|
class="flex cursor-pointer items-center gap-2 rounded px-3 py-1.5 text-left text-sm hover:bg-gray-100 dark-theme:hover:bg-zinc-700"
|
|
@click="handleClick"
|
|
>
|
|
<i v-if="option.icon" :class="[option.icon, 'h-4 w-4']" />
|
|
<span class="flex-1">{{ option.label }}</span>
|
|
<span v-if="option.shortcut" class="text-xs opacity-60">
|
|
{{ option.shortcut }}
|
|
</span>
|
|
<i
|
|
v-if="option.hasSubmenu"
|
|
:size="14"
|
|
class="icon-[lucide--chevron-right] opacity-60"
|
|
/>
|
|
<Badge
|
|
v-if="option.badge"
|
|
:severity="option.badge === 'new' ? 'info' : 'secondary'"
|
|
:value="t(option.badge)"
|
|
:class="{
|
|
'rounded-4xl bg-[#31B9F4] dark-theme:bg-[#0B8CE9]':
|
|
option.badge === 'new',
|
|
'rounded-4xl bg-[#9C9EAB] dark-theme:bg-[#000]':
|
|
option.badge === 'deprecated',
|
|
'h-4 gap-2.5 px-1 text-[9px] text-white uppercase': true
|
|
}"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Badge from 'primevue/badge'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import type { MenuOption } from '@/composables/graph/useMoreOptionsMenu'
|
|
|
|
const { t } = useI18n()
|
|
|
|
interface Props {
|
|
option: MenuOption
|
|
}
|
|
|
|
interface Emits {
|
|
(e: 'click', option: MenuOption, event: Event): void
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
const emit = defineEmits<Emits>()
|
|
|
|
const handleClick = (event: Event) => {
|
|
emit('click', props.option, event)
|
|
}
|
|
</script>
|