---
url: /reference/interface/capabilities/idea.md
---

# idea

`idea` 允许你的应用能够直接调用创建产品需求、打开产品需求详情。

导入：

```typescript
import { idea } from '@pc-nexus/capabilities';
```

内置方法：

## openCreate

`openCreate` 打开产品需求创建弹窗，根据传入的默认值展示数据。

### 函数签名

```typescript
function openCreate(options?: IdeaOpenCreateOptions): Promise<void>;

export interface IdeaOpenCreateOptions {
    defaultValues?: {
        title?: string;
        product_id?: string;
    };
    onSuccess?: (payload: Idea) => void;
}

export interface Idea {
    id: string;
    short_id: string;
    identifier: string;
    title: string;
}
```

### 参数

`IdeaOpenCreateOptions` 类型定义如下：

`onSuccess`  类型定义如下：

### 返回值

空

### 示例

```typescript
import { idea } from '@pc-nexus/capabilities';

idea.openCreate({
    defaultValues: {
      title: '新需求',
    },
    onSuccess: (payload) => {
      console.log('create idea success', payload);
    },
});
```

## openDetail

`openDetail` 打开产品需求详情弹窗。

### 函数签名

```typescript
function openDetail(identifier: string): Promise<void>
```

### 参数

### 返回值

空

### 示例

```typescript
import { idea } from '@pc-nexus/capabilities';

idea.openDetail('66da99b3f5075970efbe7492');
```
