集成 less
需要指定版本,否则会报错
- 5.0方案
npm install less
npm install less-loader@5.0.0 --dev
main.js中添加
import less from 'less'
Vue.use(less)
- 4.1 方案
"less": "^4.1.1",
"less-loader": "^4.1.0",
webpack.base.conf.js module rules中添加
{
test: /\.less$/,
loader: 'style-loader!css-loader!less-loader'
}
- 使用
<style lang="less" scoped>
@import "index";
</style>