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
主题
ColorPrimary:文字颜色:
- Conversation - 1
- Conversation - 2
Do you want?
Hot Topics
Hot Topics
What are you interested in?
What's new in X?
What's AGI?
Where is the doc?
Design Guide
Design Guide
How to design a good product?
Know the well
Set the AI role
Express the feeling
Start Creating
Start Creating
How to start a new project?
Fast Start
Install Ant Design X
Online Playground
Play on the web without installing
国际化
Change locale of components:
- 帮我写作
- AI编码
- 图片生成
- 深度搜索
快捷键
You can switch sessions using the shortcut key: Alt/⌥ + number
- Help Me Write
- AI Coding
- Create Image
- Deep Search
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 | - | - |
| mermaid | Mermaid 图表组件的全局配置 | 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。
贡献者
贡献者
正在加载贡献者信息...