{"action":"opened","issue":{"url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1565","repository_url":"https://api.github.com/repos/RubyLouvre/avalon","labels_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1565/labels{/name}","comments_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1565/comments","events_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1565/events","html_url":"https://github.com/RubyLouvre/avalon/issues/1565","id":163982947,"number":1565,"title":"关于组件控制的两个问题，请指教","user":{"login":"dennis82530","id":1287244,"avatar_url":"https://avatars.githubusercontent.com/u/1287244?v=3","gravatar_id":"","url":"https://api.github.com/users/dennis82530","html_url":"https://github.com/dennis82530","followers_url":"https://api.github.com/users/dennis82530/followers","following_url":"https://api.github.com/users/dennis82530/following{/other_user}","gists_url":"https://api.github.com/users/dennis82530/gists{/gist_id}","starred_url":"https://api.github.com/users/dennis82530/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennis82530/subscriptions","organizations_url":"https://api.github.com/users/dennis82530/orgs","repos_url":"https://api.github.com/users/dennis82530/repos","events_url":"https://api.github.com/users/dennis82530/events{/privacy}","received_events_url":"https://api.github.com/users/dennis82530/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-06T01:55:35Z","updated_at":"2016-07-06T01:55:35Z","closed_at":null,"body":"> built in 2016-7-6:3 version 2.10\r\n---\r\n\r\n1. 请教，如果在一个页面上，多次调用同一个 `avalon` 组件, 如何保证其相应的 `VM` 保持独立？（想达到通过每个相同的组件独立控制的目的）\r\n\r\n2. `avalon` 组件在 `ms-for` 的循环中，只展现在最后一个循环元素中，且其 `wid` 属性为 `undefined`，这是为什么？（直觉上认为组件应在每个循环元素中都有展现）\r\n\r\n---\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <title></title>\r\n    <meta charset=\"UTF-8\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <script src=\"../dist/avalon.js\"></script>\r\n    <script>\r\n        var vm = avalon.define({\r\n            $id: 'test',\r\n            tests: [0,1]\r\n        })\r\n    avalon.component('ms-button', {\r\n        template: '<button type=\"button\"><span><slot name=\"buttonText\"></slot></span></button>',\r\n        defaults: {\r\n            buttonText: \"默认内容\"\r\n        },\r\n        soleSlot: 'buttonText'\r\n    })\r\n     </script>\r\n</head>\r\n<body>\r\n<ul ms-constroller=\"test\">\r\n     <li ms-for=\"test in @tests\">\r\n        <span ms-text=\"test\"></span>\r\n        <xmp ms-widget='{is:\"ms-button\"}'></xmp>\r\n    </li>\r\n</ul>\r\n</body>\r\n</html>\r\n```"}}
{"actor":{"display_login":"dennis82530"}}