chore: format code

This commit is contained in:
vben
2024-06-08 19:49:06 +08:00
parent d584d4cf4e
commit 7bcd7746ca
187 changed files with 775 additions and 587 deletions

View File

@@ -1,12 +1,12 @@
<script lang="ts" setup>
import { VbenIcon, VbenMenuBadge, VbenTooltip } from '@vben-core/shadcn-ui';
import { useNamespace } from '@vben-core/toolkit';
import type { MenuItemProps, MenuItemRegistered } from '../interface';
import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue';
import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
import { VbenIcon, VbenMenuBadge, VbenTooltip } from '@vben-core/shadcn-ui';
import { useNamespace } from '@vben-core/toolkit';
import type { MenuItemProps, MenuItemRegistered } from '../interface';
import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
interface Props extends MenuItemProps {}

View File

@@ -1,8 +1,11 @@
<script lang="ts" setup>
import { IcRoundMoreHoriz } from '@vben-core/iconify';
import { isHttpUrl, useNamespace } from '@vben-core/toolkit';
import type {
MenuItemClicked,
MenuItemRegistered,
MenuProps,
MenuProvider,
} from '../interface';
import { UseResizeObserverReturn, useResizeObserver } from '@vueuse/core';
import {
type VNodeArrayChildren,
computed,
@@ -15,6 +18,11 @@ import {
watchEffect,
} from 'vue';
import { IcRoundMoreHoriz } from '@vben-core/iconify';
import { isHttpUrl, useNamespace } from '@vben-core/toolkit';
import { UseResizeObserverReturn, useResizeObserver } from '@vueuse/core';
import {
createMenuContext,
createSubMenuContext,
@@ -23,13 +31,6 @@ import {
import { flattedChildren } from '../utils';
import SubMenu from './sub-menu.vue';
import type {
MenuItemClicked,
MenuItemRegistered,
MenuProps,
MenuProvider,
} from '../interface';
interface Props extends MenuProps {}
defineOptions({ name: 'Menu' });

View File

@@ -1,11 +1,11 @@
<script setup lang="ts">
import type { MenuRecordRaw } from '@vben-core/typings';
import type { NormalMenuProps } from './normal-menu';
import { VbenIcon } from '@vben-core/shadcn-ui';
import { useNamespace } from '@vben-core/toolkit';
import type { NormalMenuProps } from './normal-menu';
interface Props extends NormalMenuProps {}
defineOptions({

View File

@@ -1,4 +1,8 @@
<script lang="ts" setup>
import type { MenuItemProps } from '../interface';
import { computed } from 'vue';
import {
IcRoundChevronRight,
IcRoundKeyboardArrowDown,
@@ -6,12 +10,8 @@ import {
import { VbenIcon } from '@vben-core/shadcn-ui';
import { useNamespace } from '@vben-core/toolkit';
import { computed } from 'vue';
import { useMenuContext } from '../hooks';
import type { MenuItemProps } from '../interface';
interface Props extends MenuItemProps {
isMenuMore: boolean;
isTopLevelMenuSubmenu: boolean;

View File

@@ -1,11 +1,17 @@
<script lang="ts" setup>
import type { HoverCardContentProps } from '@vben-core/shadcn-ui';
import { VbenHoverCard } from '@vben-core/shadcn-ui';
import { useNamespace } from '@vben-core/toolkit';
import type {
MenuItemRegistered,
MenuProvider,
SubMenuProps,
} from '../interface';
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
import { VbenHoverCard } from '@vben-core/shadcn-ui';
import { useNamespace } from '@vben-core/toolkit';
import {
createSubMenuContext,
useMenu,
@@ -16,12 +22,6 @@ import {
import CollapseTransition from './collapse-transition.vue';
import SubMenuContent from './sub-menu-content.vue';
import type {
MenuItemRegistered,
MenuProvider,
SubMenuProps,
} from '../interface';
interface Props extends SubMenuProps {
isSubMenuMore?: boolean;
}

View File

@@ -1,9 +1,9 @@
import type { MenuProvider, SubMenuProvider } from '../interface';
import { getCurrentInstance, inject, provide } from 'vue';
import { findComponentUpward } from '../utils';
import type { MenuProvider, SubMenuProvider } from '../interface';
const menuContextKey = Symbol('menuContext');
/**

View File

@@ -1,10 +1,10 @@
<script setup lang="ts">
import type { MenuRecordRaw } from '@vben-core/typings';
import { VbenMenuBadge } from '@vben-core/shadcn-ui';
import { computed } from 'vue';
import { VbenMenuBadge } from '@vben-core/shadcn-ui';
import { MenuItem, SubMenu as SubMenuComp } from './components';
// eslint-disable-next-line import/no-self-import
import SubMenu from './sub-menu.vue';

View File

@@ -4,7 +4,6 @@ import type {
VNodeChild,
VNodeNormalizedChildren,
} from 'vue';
import { isVNode } from 'vue';
type VNodeChildAtom = Exclude<VNodeChild, Array<any>>;