{"action":"created","issue":{"url":"https://api.github.com/repos/javaLuo/react-luo/issues/16","repository_url":"https://api.github.com/repos/javaLuo/react-luo","labels_url":"https://api.github.com/repos/javaLuo/react-luo/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/javaLuo/react-luo/issues/16/comments","events_url":"https://api.github.com/repos/javaLuo/react-luo/issues/16/events","html_url":"https://github.com/javaLuo/react-luo/issues/16","id":307877690,"number":16,"title":"批量引入图片","user":{"login":"zhans1993","id":20674711,"avatar_url":"https://avatars0.githubusercontent.com/u/20674711?v=4","gravatar_id":"","url":"https://api.github.com/users/zhans1993","html_url":"https://github.com/zhans1993","followers_url":"https://api.github.com/users/zhans1993/followers","following_url":"https://api.github.com/users/zhans1993/following{/other_user}","gists_url":"https://api.github.com/users/zhans1993/gists{/gist_id}","starred_url":"https://api.github.com/users/zhans1993/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhans1993/subscriptions","organizations_url":"https://api.github.com/users/zhans1993/orgs","repos_url":"https://api.github.com/users/zhans1993/repos","events_url":"https://api.github.com/users/zhans1993/events{/privacy}","received_events_url":"https://api.github.com/users/zhans1993/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-23T02:17:11Z","updated_at":"2018-03-23T04:57:31Z","closed_at":null,"author_association":"NONE","body":"luo哥你好， 碰到个批量引入图片的问题 ，按照之前的方式，图片需要 import 引入，一个一个引入的话，得写一堆，目前  我是通过   require('../../../images/12star/star_' + item.id + '.png'); 这种替换  id 拼字符串的来写的，有什么更好的方法呢，十分感谢！！！"},"comment":{"url":"https://api.github.com/repos/javaLuo/react-luo/issues/comments/375545274","html_url":"https://github.com/javaLuo/react-luo/issues/16#issuecomment-375545274","issue_url":"https://api.github.com/repos/javaLuo/react-luo/issues/16","id":375545274,"user":{"login":"javaLuo","id":7686097,"avatar_url":"https://avatars0.githubusercontent.com/u/7686097?v=4","gravatar_id":"","url":"https://api.github.com/users/javaLuo","html_url":"https://github.com/javaLuo","followers_url":"https://api.github.com/users/javaLuo/followers","following_url":"https://api.github.com/users/javaLuo/following{/other_user}","gists_url":"https://api.github.com/users/javaLuo/gists{/gist_id}","starred_url":"https://api.github.com/users/javaLuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javaLuo/subscriptions","organizations_url":"https://api.github.com/users/javaLuo/orgs","repos_url":"https://api.github.com/users/javaLuo/repos","events_url":"https://api.github.com/users/javaLuo/events{/privacy}","received_events_url":"https://api.github.com/users/javaLuo/received_events","type":"User","site_admin":false},"created_at":"2018-03-23T04:57:31Z","updated_at":"2018-03-23T04:57:31Z","author_association":"OWNER","body":"我也是用的这种方法。\r\n如果有多张图片，比如表情gif，就用for循环，全部require进一个数组。\r\n下面是以前写的代码：\r\n```\r\n// 所有的表情包对象\r\n\r\nconst emojis = (() =>\r\n    const map = [];\r\n    for (let i = 1; i <= 132; i++) {\r\n      const e = require(`./emoji/${i}.gif`);\r\n      map.push(e);\r\n    }\r\n    return map;\r\n})();\r\n```\r\n"}}
{"actor":{"display_login":"javaLuo"}}