{"action":"created","issue":{"url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/11","repository_url":"https://api.github.com/repos/Meituan-Dianping/mpvue","labels_url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/11/comments","events_url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/11/events","html_url":"https://github.com/Meituan-Dianping/mpvue/issues/11","id":303758779,"number":11,"title":"使用 babel-plugin-transform-decorators-legacy babel插件支持装饰器语法，出现`Syntax Error: Unexpected token`的错","user":{"login":"weineel","id":13328625,"avatar_url":"https://avatars3.githubusercontent.com/u/13328625?v=4","gravatar_id":"","url":"https://api.github.com/users/weineel","html_url":"https://github.com/weineel","followers_url":"https://api.github.com/users/weineel/followers","following_url":"https://api.github.com/users/weineel/following{/other_user}","gists_url":"https://api.github.com/users/weineel/gists{/gist_id}","starred_url":"https://api.github.com/users/weineel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weineel/subscriptions","organizations_url":"https://api.github.com/users/weineel/orgs","repos_url":"https://api.github.com/users/weineel/repos","events_url":"https://api.github.com/users/weineel/events{/privacy}","received_events_url":"https://api.github.com/users/weineel/received_events","type":"User","site_admin":false},"labels":[{"id":858621315,"url":"https://api.github.com/repos/Meituan-Dianping/mpvue/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-03-09T08:16:52Z","updated_at":"2018-04-03T14:29:23Z","closed_at":"2018-03-11T03:43:37Z","author_association":"NONE","body":"### 测试代码\r\n\r\n```\r\nfunction defaultResult(target, name, descriptor) {\r\n  const oFunc = descriptor.value\r\n  descriptor.value = function(...arg) {\r\n    return new Promise((resolve, reject) => {\r\n      oFunc.apply(target, arg)\r\n        .then(data => {\r\n          console.log(data)\r\n        })\r\n        .catch(err => reject(err))\r\n    })\r\n  }\r\n\r\n  return descriptor\r\n}\r\n\r\nclass CustomerTotalApi {\r\n\r\n  @defaultResult\r\n  static getXXX() {\r\n    return new Promise((resolve, reject) => {\r\n      setTimeout(() => {\r\n        resolve('CustomerTotalApi descriptor')\r\n      }, 2000)\r\n    })\r\n  }\r\n}\r\n\r\nexport default CustomerTotalApi\r\n\r\n```\r\n\r\n> 以上代码通过babel命令行和`babel-plugin-transform-decorators-legacy`插件可以正常编译。\r\n\r\n### error\r\n![image](https://user-images.githubusercontent.com/13328625/37197028-05ac1fe0-23b4-11e8-8b00-cc5196ae9637.png)\r\n\r\n### 通过修改`mpvue-loader`的配置可以时错误消失，但是无法生成小程序项目了。\r\n![image](https://user-images.githubusercontent.com/13328625/37197170-b41cd79a-23b4-11e8-8bce-0b5c910969fd.png)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/comments/378270072","html_url":"https://github.com/Meituan-Dianping/mpvue/issues/11#issuecomment-378270072","issue_url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/11","id":378270072,"user":{"login":"weineel","id":13328625,"avatar_url":"https://avatars3.githubusercontent.com/u/13328625?v=4","gravatar_id":"","url":"https://api.github.com/users/weineel","html_url":"https://github.com/weineel","followers_url":"https://api.github.com/users/weineel/followers","following_url":"https://api.github.com/users/weineel/following{/other_user}","gists_url":"https://api.github.com/users/weineel/gists{/gist_id}","starred_url":"https://api.github.com/users/weineel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weineel/subscriptions","organizations_url":"https://api.github.com/users/weineel/orgs","repos_url":"https://api.github.com/users/weineel/repos","events_url":"https://api.github.com/users/weineel/events{/privacy}","received_events_url":"https://api.github.com/users/weineel/received_events","type":"User","site_admin":false},"created_at":"2018-04-03T14:29:23Z","updated_at":"2018-04-03T14:29:23Z","author_association":"NONE","body":"@Stupidism \r\n我遇到的问题已经在mpvue-loader@1.0.2中解决了。\r\n你遇到的问题具体是怎样的？"}}
{"actor":{"display_login":"weineel"}}