# vue2_test **Repository Path**: zy_laoyang/vue2_test ## Basic Information - **Project Name**: vue2_test - **Description**: vue2练习 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 11 - **Created**: 2021-11-16 - **Last Updated**: 2023-03-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vue01 > A Vue.js project > vue init webpack vue01 > > cd vue01 ## Build Setup ``` bash # install dependencies npm install # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build # build for production and view the bundle analyzer report npm run build --report # run unit tests npm run unit # run e2e tests npm run e2e # run all tests npm test ``` For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 在修改了src之后,也自动修改了启动路径 module.exports = { context: path.resolve(__dirname, '../'), entry: { //启动路径在这里 app: './src/main.js' } 没办法,只能手动改回来了 其后报错 >You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file. 修改: webpack.base.conf.js module: { rules: [ 注释了下面这行内容 // ...(config.dev.useEslint ? [createLintingRule()] : []), 支持less npm i less less-loader --save -dev 编译失败提示建议下载vue-style-loader npm install --save vue-style-loader css-loader 问题还在 npm install sass-loader --save; npm install node-sass --save; ``` node_modules/less npm ERR! less@"^4.1.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer less@"^2.3.1 || ^3.0.0" from less-loader@5.0.0 npm ERR! node_modules/less-loader npm ERR! less-loader@"5.0.0" from the root project npm ERR! ``` 错误报告是安装的版本问题 > npm uninstall less > > npm uninstall less-loader > 安装指定版本 npm i less@2.3.1 npm i less-loader@5.0.0 问题解决 npm i nanoid 加个用来生成id的 加个消息管理 pubsub.js npm i pubsub-js 应用外部动画效果,需要引入一个样式库 npm install animate.css --save 无效,找不到相应类,后来发现好像类名和文件不同,感觉可能是之前一样的问题 查了一个,果然是版本问题,有人说用3.5版本 npm uninstall animate.css npm install animate.css@3.5.1 --save 还是不行,再换个试试 npm view animate.css versions 放弃第三方动画了。。。。 ajax npm i axios bootstrap 尝试 npm i bootstrap --save 添加插件 npm i vuex 项目发布: npm run build 生成项目文件dist 新建了文件夹,pubvue 进入文件夹 npm init 初始化 npm i express 完成后 使用ide 打开 编写server.js 复制发布的内容到指定的文件夹下,就可以启动服务了 ---------------------------------- 应用第三方控件 npm i element-ui -S