webpack4配置css模块化问题

求助各位大佬~~~~~

我在css-loader里面配置了modules:true后,样式就不起作用了(可以在html文件中看到引入了,但是类名变成了其他一长串字符)。去掉modules:true之后样式一切1正常显示。这是怎么一回事呢????

配置如下图,感激不尽!!!

http://img3.mukewang.com/5ea690fa00013d1305270383.jpg

慕盖茨6136029
浏览 1103回答 0
0回答

慕斯4360584

KGSPCPVTJYSJILWDTHQNUKVRNGUCNNKBBSEDAAUHZWXNCRXXIVVCJPHSLHQDAGNDUORGCWJSJSPWVPUAAXOUEXDDPNQXKHDTAFVJVLRVJJIWWYSENKALOYNNNHTRRMMSYVSSEJZPGQWWAHPYZOOCVYYPVPUUDGRUUUOOYBRHNKXKSIFWKQPPCZLCSJSXTJHVPFFVIIHMVXUHNDQUEXTTUBLKKRIBEAMTZGWMDCLNJJJWRHNKRAQZIZMZXGXKUSHDJNDZBIOYZVEYIMZPGOYJPVOVIIOFMLPYOBELRROOOFBHKHEUOUJTFBHXAXDVSZYTIKQNTPTRIHDFOEYVRIYFYQEKAEHEDNQJBGJCMYUAHRKAWFBYRDNXUGLGKGEXXGNWDMEQSYLEUUKKYKQJZPERYYXFLXXTAWPFPVXMDCUIIYHHHVENQATGPFWGVVLUAEDWMZCHPVBOHBLREWGVBRRGPMTGPXSOUSFOHBUMTEAIIUKFLBBHWJHNAGZTSSOTZLLSEKQGQDFUQQWCVBCTGLRNXXNWWTJNZOLURUUKKKCUUGHHXGNWZWMLOHUATTDLYYHTTTPFFVHAMSSMJFPYANAGSPZVVDNNZRWILLOORUUFYNJZZVLEVEULQCFIVFULRUUEMPVSHKAQGCFRGDQPFQZMKWJWZMXHQUJVBNGJPFFCBPJIYWDGCSSTZMKTJCWQJAGMYODHXKIRBER

慕慕5436299

ANQATXWVLYSXEKTKHHQWQAMLXEHKAUUUNHAGGNXYPIQWXQNMHEXXHZGKNGGTJPBRPCVTMCZZIZIZWMDHHOEBRBHRBPTZCSQTJTXJDPZWZEEOVRJZSSFSVVZHKRFGDTOUSF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DMVEFCFTIKNDFCYUKNDZBENJYBXOENPZCWZJMOSC

weixin_慕先生1446675

那段字符串是哈希值,当你css引入的时候是一个对象,那段字符串就是对象里某个类名的value,如果在react里,className={style.main}  ps: import style from './style.css'; style.css里有个.main{border: 1px solid red};
打开App,查看更多内容
随时随地看视频慕课网APP