Skip to content

aliya-psn/VueApp

Repository files navigation

app

A Vue.js project

Build Setup

# 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

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

/************************* 注释 *********************/

开发中的变更

安装的依赖库

npm install fastclick --save 解决点击事件间隔300毫秒的问题 npm install stylus --save 样式 npm install stylus-loader --save 样式 npm uninstall [email protected] --save 轮播图 npm install axios --save 网络请求

安装完依赖库需要重启npm npm run start

/**** 关于css样式 ****/

导入的css样式

border.css 解决在2倍屏或3倍屏下1px显示转化的问题 reset.css 通用的css样式

iconfont相关的css样式 (如果更新了iconfont图标,需要替换一下文件)

iconfont iconfont.eot iconfont.svg iconfont.ttf iconfont.woff iconfont.css

自定义css样式 在文件中引入css样式 需要使用 @import 例如:@import '~styles/mixins.styl';

mixins.styl // 常用的自定义样式方法 variable.styl // 一些常用的自定义样式

/**** 关于一些配置修改 ****/

自定义文件路径别名

在webpack.base.conf.js 中修改alias 设置成想要的简介路径

开发环境网络请求代理配置

在config/index.js中 proxyTable配置网络请求代理

router

在router/index.js中 添加scrollBehavior方法,设置页面滚动位置不会相互影响

为了使得webpack支持IP访问,需要在package.json中加入一项配置

--host 0.0.0.0

打包在后台文件中,想修改页面的访问路径

在config/index.js中,设置assetsPublicPath 例如:'./project'

异步组件 按需加载 只有在app.js文件很大的时候才会选择异步按需加载,否则没有必要

在config/index.js中,设置component: () => import('@pages/home/Home')

/**** 关于项目结构 ****/

项目结构

res assets styles iconfont iconfont.eot iconfont.svg iconfont.ttf iconfont.woff iconfont.css border.css mixins.styl reset.css variable.styl pages home Home.vue components Header.vue Icon.vue Swiper.vue Recommend.vue Weekend.vue router index.js App.vue main.js static (只有该目录下的文件可以被外部访问到) mock home.json

About

Vue 移动端项目(仿去哪儿网)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages