初始化项目

  • 在 src/assets 中添加样式初始化文件 reset.css ; border.css

  • 本地引入取消延迟300毫秒的控件

    cnpm i fastclick -S

  • 在mian.js中引入 初始化样式文件及文件的是用

    import fastClick from ‘fastclick’

    import ‘./assets/reset.css’

    import ‘./assets/border.css’

    fastClick.attach(document.body)

旅游网站首页开发

header区域开发
  • 使用stylus编写css样式

    cnpm i stylus stylus-loader -S
  • 给的UI涉设计图为750px 即使以iPhone6/7/8 为准

    - 在reset中设置

    html { font-size: 50px }

    - 在样式文件中单位就为UI设计图中原来的1%
iconfont的使用和代码优化
  • https://www.iconfont.cn 选择图标并下载本地

  • src/assets中放入iconfont目录及iconfont.css
  • 修改iconfont.css文件中src: url()路径 ./iconfont/iconfont.eot..
  • main.js中引入
    •   `import './assets/iconfont.css'`
  • 创建公共样式 在style目录下创建varibles.styl
    •   `$bgColor = #00bcd4`
  • 引入并使用
    •    `@import '~@/assets/styles/varibles.styl'`
    •   `background: $bgColor`

header.vue

<template>
<div class="header">
<div class="header-left">
<div class="iconfont back-icon"></div>
</div>
<div class="header-input">
<span class="iconfont"></span>
输入城市/景点/游玩主题
</div>
<router-link to='/city'>
<div class="header-right">
<span class="iconfont arrow-icon"></span>
</div>
</router-link>
</div>
</template> <script>
export default {
name: 'HomeHeader'
}
</script> <style lang="stylus" scoped>
@import '~@/assets/styles/varibles.styl'
.header
display: flex
line-height: .86rem
background: $bgColor
color: #fff
.header-left
width: .64rem
float: left
.back-icon
text-align: center
font-size: .4rem
.header-input
flex: 1
height: .64rem
line-height: .64rem
margin-top: .12rem
margin-left: .2rem
padding-left: .2rem
background: #fff
border-radius: .1rem
color: #ccc
.header-right
min-width: 1.04rem
padding: 0 .1rem
float: right
text-align: center
color: #fff
.arrow-icon
margin-left: -.04rem
font-size: .24rem
</style>
首页轮播图
  • 在GitHub中搜索 vue-awesome-swiper

  • 在组件实例属性name中不要写Swiper, 会导致swiper组件报错
  • 避免轮播图未加载出来时下方的内容跑到上面来

    - 在html中外层添加 <div class='wraper'></div>

    - 在style中定义wraper高度 .wrapper{overflow hidden; width: 100%; height: 0; padding-bottom: 31.25% }

    padding-bottm: 轮播图的高度/轮播图的宽度*100%

    - 全局设置 swiper-pagination 的样式

    .wrapper >>> swiper-pagination-bullet-active( background: #f00)

swiper.vue

<template>
<div class="wrapper">
<swiper :options="swiperOption">
<swiper-slide v-for="item in swiperList"><img class="swiper-img" :src="item.imgUrl"></swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
</div>
</template> <script>
export default {
name: 'HomeSwiper',
data () {
return {
swiperOption: {
pagination: '.swiper-pagination',
loop: true
},
swiperList: [{
id: '001',
imgUrl: 'http://mp-piao-admincp.qunarzz.com/mp_piao_admin_mp_piao_admin/admin/20192/9f73976e40c4ef845cabe0efc0269ebb.jpg_750x200_aab92b7a.jpg'
},
{ id: '002',
imgUrl: 'http://mp-piao-admincp.qunarzz.com/mp_piao_admin_mp_piao_admin/admin/20193/2f5f3ea4698c9b7898db7562d89b91ed.jpg_750x200_bd3b4ce9.jpg' }, {
id: '003',
imgUrl: 'http://mp-piao-admincp.qunarzz.com/mp_piao_admin_mp_piao_admin/admin/20193/534106663f424042868365167e4a66ff.jpg_750x200_3ec12f21.jpg' }]
}
}
}
</script>
<style lang="stylus" scoped>
.wrapper >>> swiper-pagination-bullet-active
background: #f00
.wrapper
overflow: hidden
width: 100%
height: 0
padding-bottom: 26.6666%
.swiper-img
width: 100%
</style>

vue2.5开发去哪儿了流程的更多相关文章

  1. Vue2.5 开发去哪儿网App

    Vue2.5开发去哪儿网App 技术栈和主要框架

  2. Vue2.5开发去哪儿网App 首页开发

    主页划 5 个组件,即 header  icon  swiper recommend weekend 一. header区域开发 1. 安装 stylus npm install stylus --s ...

  3. Vue2.5开发去哪儿网App 从零基础入门到实战项目

    第1章 课程介绍本章主要介绍课程的知识大纲,学习前提,讲授方式及预期收获. 1-1 课程简介 试看第2章 Vue 起步本章将快速讲解部分 Vue 基础语法,通过 TodoList 功能的编写,在熟悉基 ...

  4. Vue2.5开发去哪儿网App 城市列表开发之 Vuex实现数据共享及高级使用

    一,数据共享 1.  安装: npm install vuex --save 2. 在src目录下 新建state文件夹,新建index.js文件 3. 创建一个 store import Vue f ...

  5. Vue2.5开发去哪儿网App 搜索功能完成

    效果展示: Search.vue: <div class="search-content" ref="search" v-show="keywo ...

  6. Vue2.5开发去哪儿网App 城市列表开发之 兄弟组件间联动及列表性能优化

    一,  兄弟组件间联动 1.  点击城市字母,左侧对应显示 给遍历的 字母 添加一个点击事件: Alphabet.vue @click="handleLetterClick" ha ...

  7. Vue2.5开发去哪儿网App 城市列表开发

     一,城市选择页面路由配置                                                                                        ...

  8. Vue2.5开发去哪儿网App 详情页面开发

    一,banner 图的设计 1. 新建detail的路由 import Detail from '@/pages/detail/Detail' ...... { path: '/detail', na ...

  9. Vue2.5开发去哪儿网App 第五章笔记 下

    1. 多个元素或组件的过渡 多个元素的过渡: <style> .v-enter,.v-leace-to{ opacity: 0; } .v-enter-active,.v-leave-ac ...

随机推荐

  1. python:**kwargs

    **kwargs接收键值对参数,即字典, dict的pop()函数内需传2个参数,第一个参数为dict内的key, 如果有该key>第二个参数为None,最后的结果就是该key对应的value. ...

  2. 基于vue的实时视频流开发

    背景:多个实时视频的介入 技术:hls.js的流媒体,支持格式已m3u8为主 解决了什么:多个实时视频长时间播放会有卡顿的情况 具体代码实现: import Hls from 'hls.js' pla ...

  3. puppeteer去掉同源策略及请求拦截

    puppeteer是一个功能强大的工具,在自动化测试和爬虫方面应用广泛,这里谈一下如何在puppeteer中关掉同源策略和进行请求拦截. 同源策略 同源策略为web 安全提供了有力的保障,但是有时候我 ...

  4. Go | Go 语言打包静态文件以及如何与Gin一起使用Go-bindata

    系列文章目录 第一章 Go 语言打包静态文件以及如何与Gin一起使用Go-bindata 目录 系列文章目录 前言 一.go-bindata是什么? 二.使用步骤 1. 安装 2. 使用 3. 读取文 ...

  5. chrome浏览器截图

    1.F12 打开开发者工具台 2.ctrl + shift + p,弹出搜索框之后输入: full 3.选中Mobile-- Capture fullsize screenshot ,成功保存图片.

  6. Java面试题(Spring Boot/Spring Cloud篇)

    Spring Boot/Spring Cloud 104.什么是 spring boot? SpringBoot是一个框架,一种全新的编程规范,他的产生简化了框架的使用,所谓简化是指简化了Spring ...

  7. Windows 远程桌面鼠标光标不可见

    一.问题描述 通过在云端的主机上部署 frp 服务,实现「使用Windows 远程桌面(RDP)从互联网侧访问内网的主机」.但是,使用 Windows 自带的远程桌面工具 RDP 连接到另一台计算机时 ...

  8. PHP - 读取EXCEL内容 存入数据库

    <?php //设置请求头 header("Content-Type:text/html;charset=utf8"); header("Access-Contro ...

  9. 3种 Springboot 全局时间格式化方式,别再写重复代码了

    本文收录在个人博客:www.chengxy-nds.top,技术资料共享,同进步 时间格式化在项目中使用频率是非常高的,当我们的 API 接口返回结果,需要对其中某一个 date 字段属性进行特殊的格 ...

  10. Mysql如何将某个字段的值,在原有的基础上+1?

    Eg: 电商项目中,需要统计某件商品的购买数量问题,这时产品提了一个bug,告诉你我需要你做一个购买数量统计?你会怎么做呢? 这里我只说我自己的思路,首先是浏览加购物车,创建订单并支付,mq消息消费后 ...