registry.json
用于运行你自己的组件注册表的架构。
registry.json 架构用于定义你的自定义组件注册表。
🌐 The registry.json schema is used to define your custom component registry.
{
"$schema": "https://shadcn-vue.com/schema/registry.json",
"name": "shadcn",
"homepage": "https://shadcn-vue.com",
"items": [
{
"name": "hello-world",
"type": "registry:block",
"title": "Hello World",
"description": "A simple hello world component.",
"files": [
{
"path": "registry/new-york/HelloWorld/HelloWorld.vue",
"type": "registry:component"
}
]
}
]
}定义
🌐 Definitions
你可以在此处查看 registry.json 的 JSON 模式 here。
🌐 You can see the JSON Schema for registry.json here.
$schema
$schema 属性用于指定 registry.json 文件的模式。
🌐 The $schema property is used to specify the schema for the registry.json file.
{
"$schema": "https://shadcn-vue.com/schema/registry.json"
}name
name 属性用于指定你的注册表名称。这用于数据属性和其他元数据。
🌐 The name property is used to specify the name of your registry. This is used for data attributes and other metadata.
{
"name": "acme"
}homepage
你的注册表主页。它用于数据属性和其他元数据。
🌐 The homepage of your registry. This is used for data attributes and other metadata.
{
"homepage": "https://acme.com"
}items
你注册表中的 items。每个项目都必须实现 registry-item schema specification。
🌐 The items in your registry. Each item must implement the registry-item schema specification.
{
"items": [
{
"name": "hello-world",
"type": "registry:block",
"title": "Hello World",
"description": "A simple hello world component.",
"files": [
{
"path": "registry/new-york/HelloWorld/HelloWorld.vue",
"type": "registry:component"
}
]
}
]
}有关更多信息,请参阅 registry-item schema 文档。
🌐 See the registry-item schema documentation for more information.