2022-12-14 16:26:32 +08:00

31 lines
512 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: demo 使用相关 API
sidebar_position: 2
---
## 数据源相关
### 请求数据源
```javascript
// 请求 userListuserList 在数据源面板中定义)
this.dataSourceMap['userList'].load({
data: {}
}).then(res => {})
.catch(error => {});
```
### 获取数据源的值
```javascript
const { userList } = this.state;
```
### 手动修改数据源值
```javascript
// 获取数据源面板中定义的值
const { user } = this.state;
// 修改 state 值
this.setState({
user: {}
});
```