sunmao-ui/examples/router/hashNested.json
2021-11-06 11:22:01 +08:00

235 lines
5.5 KiB
JSON

{
"app": {
"version": "example/v1",
"metadata": {
"name": "nested_hash_router",
"description": "nested hash router example"
},
"spec": {
"components": [
{
"id": "parent",
"type": "core/v1/router",
"properties": {
"switchPolicy": [
{
"type": "route",
"path": "/1",
"slotId": "child1",
"default": true
},
{
"type": "route",
"path": "/2",
"slotId": "child2",
"default": false
}
]
},
"traits": []
},
{
"id": "child1",
"type": "core/v1/router",
"properties": {
"switchPolicy": [
{
"type": "route",
"path": "/1",
"slotId": "grandchild1_1",
"default": true
},
{
"type": "route",
"path": "/2",
"slotId": "grandchild1_2",
"default": false
},
{
"type": "route",
"path": "/3",
"slotId": "grandchild1_3",
"default": false
}
]
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "parent",
"slot": "child1"
}
}
}
]
},
{
"id": "child2",
"type": "core/v1/router",
"properties": {
"switchPolicy": [
{
"type": "route",
"path": "/1",
"slotId": "grandchild2_1",
"default": true
},
{
"type": "route",
"path": "/2",
"slotId": "grandchild2_2",
"default": false
},
{
"type": "route",
"path": "/3",
"slotId": "grandchild2_3",
"default": false
}
]
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "parent",
"slot": "child2"
}
}
}
]
},
{
"id": "grandchild1_1",
"type": "core/v1/text",
"properties": {
"value": {
"raw": "1_1",
"format": "plain"
}
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "child1",
"slot": "grandchild1_1"
}
}
}
]
},
{
"id": "grandchild1_2",
"type": "core/v1/text",
"properties": {
"value": {
"raw": "1_2",
"format": "plain"
}
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "child1",
"slot": "grandchild1_2"
}
}
}
]
},
{
"id": "grandchild1_3",
"type": "core/v1/text",
"properties": {
"value": {
"raw": "1_3",
"format": "plain"
}
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "child1",
"slot": "grandchild1_3"
}
}
}
]
},
{
"id": "grandchild2_1",
"type": "core/v1/text",
"properties": {
"value": {
"raw": "2_1",
"format": "plain"
}
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "child2",
"slot": "grandchild2_1"
}
}
}
]
},
{
"id": "grandchild2_2",
"type": "core/v1/text",
"properties": {
"value": {
"raw": "2_2",
"format": "plain"
}
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "child2",
"slot": "grandchild2_2"
}
}
}
]
},
{
"id": "grandchild2_3",
"type": "core/v1/text",
"properties": {
"value": {
"raw": "2_3",
"format": "plain"
}
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "child2",
"slot": "grandchild2_3"
}
}
}
]
}
]
}
}
}