@linkdesign/screen
Version:
屏组件库,但使用场景又不局限于屏。主要用于BI、大盘和屏
42 lines (36 loc) • 1.7 kB
Markdown
title: API
order: 3
<br/>
| 参数名 | 说明 | 必填 | 类型 | 默认值 | 备注 |
|-------------|--------|------|--------|--------------------------------------|------|
| className | 类名 | N | String | - | |
| textOptions | 文本配置 | N | Array | ```{textStyle: {fontWeight: 400}}``` | |
| [params](#params)| | 高德天气服务请求参数配置 | Y | Object | - | [高德天气查询 api文档](https://lbs.amap.com/api/webservice/guide/api/weatherinfo) |
| onChange | 天气变化回调 | N | (lives: [Lives](#lives)) => void | - | - |
#### params
```typescript
// 高德天气服务请求参数配置
interface IWeatherParameters {
key: string; // 请求服务权限标识 用户在高德地图官网申请web服务API类型KEY
city: string; // 城市编码 输入城市的adcode,adcode信息可参考城市编码表
extensions?: 'base' | 'all'; // 气象类型 可选值:base/all base: 返回实况天气 all: 返回预报天气
output?: 'JSON' | 'XML'; // 返回格式 可选值:JSON,XML
interval?: number; // 请求频率 单位毫秒 默认20分钟
}
```
### Lives
```typescript
type Lives = {
province: string; // 省份名
city: string; // 城市名
adcode: string; // 区域编码
weather: string; // 天气现象(汉字描述)
temperature: string; // 实时气温,单位:摄氏度
winddirection: string; // 风向描述
windpower: string; // 风力级别,单位:级
humidity: string; // 空气湿度
reporttime: string; // 数据发布的时间
};
```