1.0.1 • Published 4 years ago
myf_less v1.0.1
使用方法
main.js中
import style from "myf_less";
Vue.use(style);
vue文件中
@import "node_modules/myf_less/styles/index.less";
全局引用(需要下载依赖项 style-resources-loader)
vue.config.js中
const path = require('path');//引入path模块
function resolve(dir) {
return path.join(__dirname, dir)//path.join(__dirname)设置绝对路径
}
module.exports = {
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [path.resolve(__dirname, "./node_modules/myf_less/styles/index.less")]
}
}
}