1.安装vue/cli
npm install -g @vue/cli
2.安装vue/init
npm install -g @vue/cli-init
3.执行vue安装命令
vue init webpack 文件名(mytest)
4.安装less
npm install less less-loader --save
5.配置less
rules: [
{
test: /.less$/,
loader: “style-loader!css-loader!less-loader”
}
]
放在webpack.base.conf.js文件中
‘<'style scoped lang=“less”> style中直接加lang=“less”
这里安装完后执行还可能会报错,因为less版本过高,所以需要卸载重新装或者一开始就装这个版本的
参照https://blog.csdn.net/l244112311/article/details/105844036/
6.安装antd-design
$ npm i --save ant-design-vue
7.配置antd-design
import Vue from ‘vue’;
import Antd from ‘ant-design-vue’;
import App from ‘./App’;
import ‘ant-design-vue/dist/antd.css’;
Vue.config.productionTip = false;
Vue.use(Antd);
new Vue({
el: ‘#app’,
components: { App },
template: ‘’,
});
8.也可以安装element-ui
npm i element-ui -S
9.配置element-ui
import Vue from ‘vue’;
import ElementUI from ‘element-ui’;
import ‘element-ui/lib/theme-chalk/index.css’;
import App from ‘./App.vue’;
Vue.use(ElementUI);
new Vue({
el: ‘#app’,
render: h => h(App)
});