Skip to content

XProvider 全局化配置

为组件提供统一的全局化配置。

使用说明

XProvider 继承了 antdvConfigProvider,且为 ant-design-x-vue 中的组件提供全局化配置。

如果您已经使用 antdvConfigProvider,请对您的代码做如下变更:

diff
- import { ConfigProvider } from 'ant-design-vue';
+ import { XProvider } from 'ant-design-x-vue';

  const App = () => (
-   <ConfigProvider>
+   <XProvider>
      <YourApp />
-   </ConfigProvider>
+   </XProvider>
  );

代码演示

使用

如何使用

Direction:
  • Conversation - 1
  • Conversation - 2
Hello Ant Design X!
Hello World!
Ignite Your Creativity
Tell me a Joke
Hello Ant Design X!status: success
Ant Design X help you build AI chat/platform app as ready-to-use 📦.
Hello World!status: success
Pending...status: pending

API

XProvider 完全继承 antdvConfigProvider, 属性参考:Antdv ConfigProvider

组件配置

属性说明类型默认值版本
bubble气泡组件的全局配置'classNames' | 'styles' | 'className' | 'style'-
conversations会话组件的全局配置'classNames' | 'styles' | 'className' | 'style'-
prompts提示集组件的全局配置'classNames' | 'styles' | 'className' | 'style'-
sender输入框组件的全局配置'classNames' | 'styles' | 'className' | 'style'-
suggestion建议组件的全局配置'className' | 'style'-
thoughtChain思维链组件的全局配置'classNames' | 'styles' | 'className' | 'style'-