.Footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here _/
height: 48px;
}
生成后的代码怎么会加随机数?能去掉吗?
.Footer___3uj4E {
position: absolute;
bottom: 0;
width: 100%;
/_ Set the fixed height of the footer here */
height: 48px;
}
@shenggen1987 这个是因为dva中用了css modules,具体文档这里有:https://github.com/dvajs/dva-knowledgemap#css-modules
阮一峰的文章里面也有解释:http://www.ruanyifeng.com/blog/2016/06/css_modules.html
webpack.config.js
module.exports = {
entry: __dirname + '/index.js',
output: {
publicPath: '/',
filename: './bundle.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'stage-0', 'react']
}
},
{
test: /\.css$/,
loader: "style-loader!css-loader?modules"
},
]
}
};
上面代码中,关键的一行是style-loader!css-loader?modules,它在css-loader后面加了一个查询参数modules,表示打开 CSS Modules 功能。
Most helpful comment
阮一峰的文章里面也有解释:http://www.ruanyifeng.com/blog/2016/06/css_modules.html
webpack.config.js
上面代码中,关键的一行是style-loader!css-loader?modules,它在css-loader后面加了一个查询参数modules,表示打开 CSS Modules 功能。