{"action":"created","issue":{"url":"https://api.github.com/repos/weexteam/article/issues/46","repository_url":"https://api.github.com/repos/weexteam/article","labels_url":"https://api.github.com/repos/weexteam/article/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/weexteam/article/issues/46/comments","events_url":"https://api.github.com/repos/weexteam/article/issues/46/events","html_url":"https://github.com/weexteam/article/issues/46","id":165704744,"number":46,"title":"<switch>组件","user":{"login":"Erwin11","id":6300501,"avatar_url":"https://avatars.githubusercontent.com/u/6300501?v=3","gravatar_id":"","url":"https://api.github.com/users/Erwin11","html_url":"https://github.com/Erwin11","followers_url":"https://api.github.com/users/Erwin11/followers","following_url":"https://api.github.com/users/Erwin11/following{/other_user}","gists_url":"https://api.github.com/users/Erwin11/gists{/gist_id}","starred_url":"https://api.github.com/users/Erwin11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Erwin11/subscriptions","organizations_url":"https://api.github.com/users/Erwin11/orgs","repos_url":"https://api.github.com/users/Erwin11/repos","events_url":"https://api.github.com/users/Erwin11/events{/privacy}","received_events_url":"https://api.github.com/users/Erwin11/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-15T03:35:06Z","updated_at":"2016-08-31T16:22:03Z","closed_at":null,"body":"# http://alibaba.github.io/weex/doc/components/switch.html\r\n## < switch > 组件\r\n\r\n<h2>概述</h2>\r\n\r\nweex 构建了组件<code>switch</code> 用于创造和管理类似iOS样式的On/Off 开关按钮。举个例子，在app设置中的‘muted’和‘toggle color’设置。\r\n\r\n\r\n## 子组件\r\n\r\n这个组件不支持子组件。\r\n\r\n## 属性\r\n* <code>checked</code>:<布尔值> <code>true</code> | <code>false</code>.按钮初始值的状态是开或者关。\r\n\r\n其他属性请查阅<a href=\"http://alibaba.github.io/weex/doc/references/common-attrs.html\" >基本属性</a>\r\n\r\n## 样式\r\n\r\n<b>注释</b>：这里有一些属性你不能用在此组件上，很有可能会影响布局。以下是所有非法属性：\r\n\r\n* <code>width</code>\r\n* <code>height</code>\r\n* <code>min-width</code>\r\n* <code>min-height</code>\r\n* <code>margin</code> 和 <code>margin-xx</code>\r\n* <code>padding</code> 和 <code>padding-xx</code>\r\n* <code>border</code> 和 <code>border-xx</code>\r\n  \r\n<b>基础样式</b>特别是<code>width</code>和<code>height</code>相关属性和尺寸不可配置，固定在<code>100x60</code>(750px尺寸设计下)\r\n\r\n\r\n## 事件\r\n\r\n* <code>click</code>:查阅<a href=\"http://alibaba.github.io/weex/doc/references/common-event.html\">基本事件</a>\r\n\r\n<b>基本事件</b>：查阅<a href=\"http://alibaba.github.io/weex/doc/references/common-event.html\">基本事件</a>\r\n\r\n* 支持<code>click</code>事件:查阅<a href=\"http://alibaba.github.io/weex/doc/references/common-event.html\">基本事件</a>\r\n* 支持<code>appear</code> / <code>disapper</code>事件:查阅<a href=\"http://alibaba.github.io/weex/doc/references/common-event.html\">基本事件</a>\r\n\r\n\r\n## 事件对象的参数\r\n\r\n* 对于 <code>change</code>事件：\r\n  * <code>value</code>:组件布尔值真或假。\r\n  * <timestamp>:事件的时间戳。\r\n\r\n## 例子\r\n<pre><code> \r\n\r\n&lt;div&gt;\r\n  &lt;text&gt;muted:&lt;/text&gt;\r\n  &lt;switch checked=\"true\"&gt;muted:&lt;/switch&gt;\r\n&lt;/div&gt;\r\n\r\n\r\n</code></pre>\r\n"},"comment":{"url":"https://api.github.com/repos/weexteam/article/issues/comments/243818878","html_url":"https://github.com/weexteam/article/issues/46#issuecomment-243818878","issue_url":"https://api.github.com/repos/weexteam/article/issues/46","id":243818878,"user":{"login":"guogailee","id":12292895,"avatar_url":"https://avatars.githubusercontent.com/u/12292895?v=3","gravatar_id":"","url":"https://api.github.com/users/guogailee","html_url":"https://github.com/guogailee","followers_url":"https://api.github.com/users/guogailee/followers","following_url":"https://api.github.com/users/guogailee/following{/other_user}","gists_url":"https://api.github.com/users/guogailee/gists{/gist_id}","starred_url":"https://api.github.com/users/guogailee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guogailee/subscriptions","organizations_url":"https://api.github.com/users/guogailee/orgs","repos_url":"https://api.github.com/users/guogailee/repos","events_url":"https://api.github.com/users/guogailee/events{/privacy}","received_events_url":"https://api.github.com/users/guogailee/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T16:22:03Z","updated_at":"2016-08-31T16:22:03Z","body":"如何指定开关true和false情况下的颜色和开关的样式\r\n![s60901-242043](https://cloud.githubusercontent.com/assets/12292895/18137220/11873ae6-6fda-11e6-8308-8930a3267543.jpg)\r\n"}}
{"actor":{"display_login":"guogailee"}}