初始化项目

  • 在 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. eric4 打包文件

    在.py 工程 所在目录: 按住shift,鼠标右键,在此处打开cmd或shell,然后如下操作 1.打包成文件夹 pyinstaller lrs.py 2.打包成 单文件 pyinstaller - ...

  2. 本blog的地图

    欢迎 CTRL+F收索 / CTRL+D    持续更新 C++: C++快速排序 C++归并排序 高精度 CSS: CSS实现ps基础操作 PYTHON: python爬虫教程,一篇就够了 其他推荐 ...

  3. FIRST集合、FOLLOW集合及LL(1)文法求法

    FIRST集合 定义 可从α推导得到的串的首符号的集合,其中α是任意的文法符号串. 规则 计算文法符号 X 的 FIRST(X),不断运用以下规则直到没有新终结符号或 ε可以被加入为止 : (1)如果 ...

  4. java应用中的日志介绍

    日志在应用程序中是非常非常重要的,好的日志信息能有助于我们在程序出现 BUG 时能快速进行定位,并能找出其中的原因. 但是,很多介绍 AOP 的地方都采用日志来作为介绍,实际上日志要采用切面的话是极其 ...

  5. JavaScript学习系列博客_15_栈内存、堆内存

    栈内存 - JS中的变量都是保存到栈内存中的,- 基本数据类型的值直接在栈内存中存储,- 值与值之间是独立存在,修改一个变量不会影响其他的变量 堆内存 - 对象是保存到堆内存中的,每创建一个新的对象, ...

  6. 4.oracle sql*plus常用命令

    一.sys用户和system用户Oracle安装会自动的生成sys用户和system用户(1).sys用户是超级用户,具有最高权限,具有sysdba角色,有create database的权限,该用户 ...

  7. appium配置

    前言 最近报了个班,学习关于全栈自动化相关内容.学归学.培训就像敲门砖,领人入门,同时可以比较系统性的给学习到关于这块的基础知识(比较好的培训机构).其次想着总结一些培训知识和遇到的一些问题,以供自己 ...

  8. Docker学习笔记-Dockerfile文件详解

    什么是Dockerfile? Docker中有个非常重要的概念叫做--镜像(Image).Docker 镜像是一个特殊的文件系统,除了提供容器运行时所需的程序.库.资源.配置等文件外,还包含了一些为运 ...

  9. php 正则表达式匹配(持续更新)

    正则表达式匹配网址: <?php header('Content-type:text/html;charset=utf-8'); $str = ' 百度http://www.baidu.com网 ...

  10. springMVC使用JSR303数据校验

    JSR303注解 hibernate validate是jsr 303的一个参考实现,除支持所有的标准校验注解外,他还支持扩展注解 spring4.0拥有自己独立的数据校验框架,同时支持jsr 303 ...