2.0.0
Skip to content

XProvider 全局化配置 ​

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

使用说明 ​

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

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

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
方向

这里列出了支持 rtl 方向的组件,您可以在演示中切换方向。

主题 ​

ColorPrimary:文字颜色:
  • Conversation - 1
  • Conversation - 2
Do you want?
Hot Topics

What are you interested in?

What's new in X?

What's AGI?

Where is the doc?

Design Guide

How to design a good product?

Know the well

Set the AI role

Express the feeling

Start Creating

How to start a new project?

Fast Start

Install Ant Design X

Online Playground

Play on the web without installing

主题

通过 theme 修改主题。

国际化 ​

Change locale of components:
  • 帮我写作
  • AI编码
  • 图片生成
  • 深度搜索
国际化

通过 locale 切换组件文案。可以把 ant-design-vue 的语言包和 ant-design-x-vue 的 zh_CN / en_US 合并后传入。

快捷键 ​

You can switch sessions using the shortcut key: Alt/⌥ + number
  • Help Me Write
  • AI Coding
  • Create Image
  • Deep Search
快捷键

通过 shortcutKeys 设置快捷键。

API ​

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

组件配置 ​

属性说明类型默认值版本
actions操作列表组件的全局配置ComponentStyleConfig--
attachments输入附件组件的全局配置ComponentStyleConfig--
bubble气泡组件的全局配置ComponentStyleConfig--
conversations会话组件的全局配置ComponentStyleConfig &--
fileCard文件卡片组件的全局配置ComponentStyleConfig--
prompts提示集组件的全局配置ComponentStyleConfig--
sender输入框组件的全局配置ComponentStyleConfig--
sources引用来源组件的全局配置ComponentStyleConfig--
suggestion建议组件的全局配置ComponentStyleConfig--
think思考组件的全局配置ComponentStyleConfig--
thoughtChain思维链组件的全局配置ComponentStyleConfig--
welcome欢迎组件的全局配置ComponentStyleConfig--

Markdown 组件配置 ​

属性说明类型默认值版本
highlightCode代码高亮组件的全局配置ComponentStyleConfig--
mermaidMermaid 图表组件的全局配置ComponentStyleConfig--

ComponentStyleConfig ​

ts
interface ComponentStyleConfig {
  style: CSSProperties;
  styles: Record<string, CSSProperties>;
  className: string;
  classNames: Record<string, string>;
}

ShortcutKeys ​

ts
type PrefixKeysType = {
  Ctrl: [keyof KeyboardEvent, string, string];
  Alt: [keyof KeyboardEvent, string, string];
  Meta: [keyof KeyboardEvent, string, string];
  Shift: [keyof KeyboardEvent, string, string];
};

type ShortcutKeys<CustomKey = number | 'number'> =
  | [keyof PrefixKeysType, keyof PrefixKeysType, CustomKey]
  | [keyof PrefixKeysType, CustomKey];

主题变量(Design Token) ​

XProvider 本身不提供独立 Component Token;请通过 theme 配置全局 Token 与各组件 Component Token。

贡献者 ​

贡献者

正在加载贡献者信息...