App

GitHub
一个包装器,为您的应用提供全局配置、toast和工具提示。

用法

该组件实现Reka UI ConfigProvider,为所有组件提供全局配置:

  • 使所有原语继承全局阅读方向。
  • 启用在设置正文锁定时更改滚动正文的行为。
  • 更多的控制,以防止布局移位。

它还使用ToastProvider和TooltipProvider来提供全局toast和工具提示,以及编程模式和幻灯片。

在app.vue文件中使用App组件包装整个应用程序:

app.vue
<template>
  <UApp>
    <NuxtPage />
  </UApp>
</template>
了解如何使用locale属性来更改应用的区域设置。这还可以控制Calendar、InputDate和InputTime等组件中的日期/时间格式。
了解如何使用locale属性来更改应用的区域设置。该属性还可以控制Calendar、InputDate和InputTime等组件中的日期/时间格式。

API

Props

Prop Default Type
tooltip
TooltipProviderProps
toaster
null | ToasterProps
locale
Locale<T>
portal
'body'
string | false | true | HTMLElement
dir
'ltr'
"ltr" | "rtl"

The global reading direction of your application. This will be inherited by all primitives.

scrollBody
boolean | ScrollBodyOption

The global scroll body behavior of your application. This will be inherited by the related primitives.

nonce
string

The global nonce value of your application. This will be inherited by the related primitives.

Slots

Slot Type
default
{}

Changelog

No recent changes