• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 配置数据和事件
2
3
4卡片使用json文件配置卡片使用的变量和事件,变量的声明在data字段下,事件的声明在actions字段下。
5
6
7示例:
8
9
10
11```json
12{
13    "data": {
14        "temperature": "35°C",
15        "city": "hangzhou"
16    },
17    "actions": {
18        "routerEventName": {
19            "action": "router",
20            "abilityName": "com.example.myapplication.FormAbility",
21            "params": {
22                "message": "weather",
23                "temperature": "{{temperature}}"
24            }
25        },
26        "messageEventName": {
27            "action": "message",
28            "params": {
29                "message": "weather update"
30            }
31        }
32    }
33}
34```
35