Giter VIP home page Giter VIP logo

vueapp's Introduction

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

vueapp's People

Contributors

aliya-psn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.