registry.json

用于运行自定义组件注册表的架构。

registry.json 架构用于定义您的自定义组件注册表。

registry.json
json
{
  "$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": "一个简单的 hello world 组件。",
      "files": [
        {
          "path": "registry/new-york/HelloWorld/HelloWorld.vue",
          "type": "registry:component"
        }
      ]
    }
  ]
}

定义

您可以在此处查看 registry.json 的 JSON 架构。

$schema

$schema 属性用于指定 registry.json 文件的架构。

registry.json
json
{
  "$schema": "https://shadcn-vue.com/schema/registry.json"
}

name

name 属性用于指定注册表的名称。该属性用于数据属性及其他元数据。

registry.json
json
{
  "name": "acme"
}

homepage

注册表的主页地址。该属性用于数据属性及其他元数据。

registry.json
json
{
  "homepage": "https://acme.com"
}

items

注册表中的 items 条目。每个条目必须遵循注册表条目架构规范

registry.json
json
{
  "items": [
    {
      "name": "hello-world",
      "type": "registry:block",
      "title": "Hello World",
      "description": "一个简单的 hello world 组件。",
      "files": [
        {
          "path": "registry/new-york/HelloWorld/HelloWorld.vue",
          "type": "registry:component"
        }
      ]
    }
  ]
}

更多信息请参阅注册表条目架构文档

Edit this page on GitHub