仪表板组

GitHub
一个固定的布局组件,为仪表板组件提供侧边栏状态管理和持久性的上下文。

用法

DashboardGroup组件是包装DashboardSidebar和DashboardPanel组件以创建响应式仪表板界面的主布局。

在布局或app.vue中使用它:

layouts/dashboard.vue
<template>
  <UDashboardGroup>
    <UDashboardSidebar />

    <slot />
  </UDashboardGroup>
</template>

API

Props

Prop Default Type
as
'div'
any

The element or component this component should render as.

storage
'cookie'
"cookie" | "local"

The storage to use for the size.

storageKey
'dashboard'
string

Unique id used to auto-save size.

storageOptions
Record<string, any>

Options to pass to the underlying storage (useCookie or useStorage).

persistent
true
boolean

Whether to persist the size in the storage.

unit
'%'
"%" | "rem" | "px"

The unit to use for size values.

ui
{ base?: any; }

老虎机

Slot Type
default
{}

Theme

app.config.ts
export default defineAppConfig({
  ui: {
    dashboardGroup: {
      base: 'fixed inset-0 flex overflow-hidden'
    }
  }
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'

export default defineConfig({
  plugins: [
    vue(),
    ui({
      ui: {
        dashboardGroup: {
          base: 'fixed inset-0 flex overflow-hidden'
        }
      }
    })
  ]
})

Changelog

No recent changes