baidu / baidu/amis

v.1.80 中没有了:getComponentByName函数, 到哪里去找, 或是在那个对象中,能实现同样的效果?

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

Description

#### 实现场景:
使用方式: sdk.js
场景: js中,获取/设置组件的数值

#### 存在的问题:
官网 中:
amisScoped.getComponentByName('page1.form1').getValues()

v.1.80 中没有了:getComponentByName函数, 到哪里去找, 或是在那个对象中,能实现同样的效果?

#### 当前方案:

```
let amis = amisRequire('amis/embed');
let amisJSON = {
type: 'page',
body: {
type: 'tpl',
tpl: '${myData}'
}
};
let amisScoped = amis.embed('#root', amisJSON, {
data: {
myData: 'amis'
}
});
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the sdk.js usage and the amis/embed entry point shown in the issue, then trace the amisScoped object and the removed getComponentByName call. Done means identifying and documenting the supported v1.80 equivalent for retrieving or updating component values, with an example that matches the page1.form1 scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, frontend
Issue type
Bug
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.