{"action":"created","issue":{"url":"https://api.github.com/repos/saltjs/salt-ui/issues/8","repository_url":"https://api.github.com/repos/saltjs/salt-ui","labels_url":"https://api.github.com/repos/saltjs/salt-ui/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/saltjs/salt-ui/issues/8/comments","events_url":"https://api.github.com/repos/saltjs/salt-ui/issues/8/events","html_url":"https://github.com/saltjs/salt-ui/issues/8","id":175423256,"number":8,"title":"TabBar不支持嵌套空变量","user":{"login":"heavenwing","id":2920062,"avatar_url":"https://avatars.githubusercontent.com/u/2920062?v=3","gravatar_id":"","url":"https://api.github.com/users/heavenwing","html_url":"https://github.com/heavenwing","followers_url":"https://api.github.com/users/heavenwing/followers","following_url":"https://api.github.com/users/heavenwing/following{/other_user}","gists_url":"https://api.github.com/users/heavenwing/gists{/gist_id}","starred_url":"https://api.github.com/users/heavenwing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heavenwing/subscriptions","organizations_url":"https://api.github.com/users/heavenwing/orgs","repos_url":"https://api.github.com/users/heavenwing/repos","events_url":"https://api.github.com/users/heavenwing/events{/privacy}","received_events_url":"https://api.github.com/users/heavenwing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-07T06:29:22Z","updated_at":"2016-09-08T05:30:41Z","closed_at":null,"body":"为了根据条件隐藏TabBar.Item，使用如下代码\r\n在这个代码中如果debugTabBarItem===“”，那么就会报错。\r\n```\r\nvar debugTabBarItem = \"\";\r\n            if (this.props.debugMode) {\r\n                debugTabBarItem = (\r\n                 <TabBar.Item title=\"DEBUG\" icon=\"settings\">\r\n                    <a className=\"btn btn-warning\" href=\"/Account/Logout\">Logout</a>\r\n                 </TabBar.Item>\r\n                    );\r\n            }\r\n            return (\r\n<div>\r\n    <TabBar activeIndex={this.state.activeIndex} onChange={onChange.bind(this)}>\r\n        <TabBar.Item title=\"所有报表\" icon=\"time\">\r\n            <MyAllReportList corpId={this.props.corpId} />\r\n        </TabBar.Item>\r\n        <TabBar.Item title=\"我的收藏\" icon=\"star\">\r\n            <MyFavList corpId={this.props.corpId} />\r\n        </TabBar.Item>\r\n        {debugTabBarItem}\r\n    </TabBar>\r\n</div>\r\n```"},"comment":{"url":"https://api.github.com/repos/saltjs/salt-ui/issues/comments/245497787","html_url":"https://github.com/saltjs/salt-ui/issues/8#issuecomment-245497787","issue_url":"https://api.github.com/repos/saltjs/salt-ui/issues/8","id":245497787,"user":{"login":"gbk","id":865717,"avatar_url":"https://avatars.githubusercontent.com/u/865717?v=3","gravatar_id":"","url":"https://api.github.com/users/gbk","html_url":"https://github.com/gbk","followers_url":"https://api.github.com/users/gbk/followers","following_url":"https://api.github.com/users/gbk/following{/other_user}","gists_url":"https://api.github.com/users/gbk/gists{/gist_id}","starred_url":"https://api.github.com/users/gbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbk/subscriptions","organizations_url":"https://api.github.com/users/gbk/orgs","repos_url":"https://api.github.com/users/gbk/repos","events_url":"https://api.github.com/users/gbk/events{/privacy}","received_events_url":"https://api.github.com/users/gbk/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T05:30:41Z","updated_at":"2016-09-08T05:30:41Z","body":"你给出的最后一项 Item 是空字符串，而我理解你的需求应该是当 debugMode 为真时，你不希望展示最后一项，这样问题就来了，你既给出了这一项，又不希望展示……如果要兼容的话，在标签项长度判断和渲染兼容方面都会很纠结。\r\n我们希望只遵循简单的约定：TabBar 里面约定只会有 TabBar.Item 类型子节点，给出则展示。\r\n这样无论是展示效果还是代码结构都比较优雅～"}}
{"actor":{"display_login":"gbk"}}