> For AI agents: the complete documentation index is available at https://docs.halo.run/llms.txt, the full documentation bundle is available at https://docs.halo.run/llms-full.txt.

# 插件数据列表显示字段

此扩展点用于扩展插件数据列表的显示字段。

![插件数据列表显示字段](/img/developer-guide/plugin/extension-points/ui/plugin-list-item-field-create.png)

## 定义方式

```ts
export default definePlugin({
  extensionPoints: {
    "plugin:list-item:field:create": (
      plugin: Ref<Plugin>,
    ): EntityFieldItem[] => {
      return [
        {
          priority: 0,
          position: "start",
          component: markRaw(FooComponent),
          props: {},
          permissions: [],
          hidden: false,
        },
      ];
    },
  },
});
```

```ts title="EntityFieldItem"
export interface EntityFieldItem {
  priority: number;
  position: "start" | "end";
  component: Raw<Component>;
  props?: Record\<string, unknown\>;
  permissions?: string[];
  hidden?: boolean;
}
```

## 示例

此示例将添加一个显示插件 requires（版本要求）的字段。

```ts
import { definePlugin } from "@halo-dev/ui-shared";
import { markRaw, type Ref } from "vue";
import type { Plugin } from "@halo-dev/api-client";
import { VEntityField } from "@halo-dev/components";

export default definePlugin({
  extensionPoints: {
    "plugin:list-item:field:create": (plugin: Ref<Plugin>) => {
      return [
        {
          priority: 0,
          position: "end",
          component: markRaw(VEntityField),
          props: {
            description: plugin.value.spec.requires,
          },
          permissions: [],
          hidden: false,
        },
      ];
    },
  },
});
```

## 实现案例

- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)

## 类型定义

### Plugin

`Plugin` 由 `@halo-dev/api-client` 提供，请直接使用当前依赖中的生成类型，不要根据本页重新定义：

- `metadata`：插件名称、标签和注解等资源元数据。
- `spec`：版本、Halo 版本范围、作者、依赖和配置引用等期望状态；除 `version` 外多数属性可能为空。
- `status?`：插件运行阶段、条件、加载位置和 UI 资源等观测状态，尚未计算时可能为空。
