# condition启动模式配置 假设小程序中有如下几个页面路由: pages/home/index pages/news/list pages/news/detail?id= pages/uc/index 当我需要将启动页面设置为pages/news/detail,下列关于condition配置写法,正确的是? ## 答案 ```json "condition": { "current": 2, "list": [{ "name": "home", "path": "pages/home/index" }, { "name": "newsList", "path": "pages/news/index" }, { "name": "newsDetail", "path": "pages/news/detail", "query": "id=1" }, { "name": "uc", "path": "pages/uc/index" } ] } ``` ## 选项 ### A ```json "condition": { "list": [{ "name": "home", "path": "pages/home/index" }, { "name": "newsList", "path": "pages/news/index" }, { "name": "newsDetail", "path": "pages/news/detail", "query": "id=1" }, { "name": "uc", "path": "pages/uc/index" } ] } ``` ### B ```json "condition": { "list": [{ "name": "home", "path": "pages/home/index" }, { "name": "newsList", "path": "pages/news/index" }, { "name": "newsDetail", "path": "pages/news/detail?id=1" }, { "name": "uc", "path": "pages/uc/index" } ] } ``` ### C ```json "condition": { "list": [ { "name": "newsDetail", "path": "pages/news/detail?id=1" } ] } ``` ### D ```json "condition": { "list": [{ "name": "home", "path": "pages/home/index" }, { "name": "newsDetail", "path": "pages/news/detail?id=1" } ] } ```