baidu / baidu/amis

button icon 支持表达式

Open
#9,331 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 是否关联于某个问题吗:
目前 button 的 icon 无法通过表达式,动态获取,希望能够通过表达式动态获取

#### 预期的解决方案:
希望以下表达式能够正常渲染出 icon

```json
{
"type": "page",
"data": {
"url": "https://suda.cdn.bcebos.com/images%2F2021-01%2Fdiamond.svg",
"name": "测试"
},
"body": {
"label": "${name}",
"type": "button",
"actionType": "dialog",
"icon": "${url}",
"dialog": {
"title": "弹框",
"body": "这是个简单的弹框。"
}
}
}
```

#### 其他可接受方案:

#### 任何附加信息:

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the button component's icon rendering and the existing expression-evaluation path. Use the provided page configuration to check whether a data value can resolve the button's icon URL, and consider the issue done when that example renders the diamond icon correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.