zoukankan      html  css  js  c++  java
  • Vue2.5 旅游项目实例7 首页-周末游区域代码

    新建Weekend.vue文件,并添加到Home.vue里

    <template>
    <div>
      <home-header></home-header>
      <home-swiper></home-swiper>
      <home-icons></home-icons>
      <home-recommend></home-recommend>
      <home-weekend></home-weekend>
    </div>
    </template>
    
    <script>
    import HomeHeader from './components/Header'
    import HomeSwiper from './components/Swiper'
    import HomeIcons from './components/Icons'
    import HomeRecommend from './components/Recommend'
    import HomeWeekend from './components/Weekend'
    export default {
      name: 'Home',
      components: {
        HomeHeader,
        HomeSwiper,
        HomeIcons,
        HomeRecommend,
        HomeWeekend
      },
      data () {
        return {
        }
      }
    }
    </script>

    发现周末游区域和推荐区域只是布局不一样,复制一份Recommend.vue的代码到Weekend.vue进行修改:

    <template>
    <div>
      <div class="title">周末去哪儿</div>
      <ul>
        <li class="item border-bottom" v-for="item in WeekendList" :key="item.id">
          <div class="item-img-wrapper">
            <img class="item-img" :src="item.imgUrl" alt="" />
          </div>
          <div class="item-info">
            <p class="item-title">{{item.title}}</p>
            <p class="item-desc">{{item.desc}}</p>
          </div>
        </li>
      </ul>
    </div>
    </template>
    
    <script>
    export default {
      name: 'HomeWeekend',
      data () {
        return {
          WeekendList: [
            {
              id: '0001',
              imgUrl: 'https://imgs.qunarzz.com/sight/source/1603/6d/2f67ae0659f41f.jpg_r_640x214_bf6cbd0b.jpg',
              title: '北京-东京 5天跟团游',
              desc: '欢乐畅想 东京+横滨+富士山+镰仓+江之岛神社'
            },
            {
              id: '0002',
              imgUrl: 'https://imgs.qunarzz.com/sight/source/1811/7e/476589267ebb41.jpg_r_640x214_bf599709.jpg',
              title: '尼泊尔9晚10天',
              desc: '悬崖酒店+超视觉两大歌舞+京津冀免费联运+骑大象'
            },
            {
              id: '0003',
              imgUrl: 'https://imgs.qunarzz.com/sight/source/1811/f3/86173f863bef61.jpg_r_640x214_52b003ac.jpg',
              title: '【家庭游】升级碧桂园',
              desc: '张家界国家森林公园天门山玻璃桥凤凰双飞6日丨赠魅力湘西'
            }
          ]
        }
      }
    }
    </script>
    
    <style lang="stylus" scoped>
    @import '~styles/mixins.styl'
    .title
      margin-top: .2rem
      line-height: .8rem
      background: #eee
      text-indent: .2rem
    .item-img-wrapper
       100%
      height:0
      overflow:hidden
      padding-bottom: 37.09%
      .item-img
         100%
    .item-info
      padding:.1rem
      .item-title
        line-height:.54rem
        font-size: .32rem
        ellipsis()
      .item-desc
        line-height:.4rem
        font-size: .28rem
        color:#ccc
        ellipsis()
    </style>

    效果图:

      

    然后提交代码:

    git add .
    git commit -m "推荐及周末区域代码"
    git push

    合并到master:

    git checkout master
    git merge index-recommend
    git push
  • 相关阅读:
    LeetCode.5-最长回文子串(Longest Palindromic Substring)
    LeetCode.3-最长无重复字符子串(Longest Substring Without Repeating Characters)
    2013 最新的 play web framework 版本 1.2.3 框架学习文档整理
    play framework学习笔记之 模板引擎
    C# 枚举、字符串、值的相互转换
    styleCop
    配置VS代码生成工具ReSharper快捷键
    StackOverflow Update: 560M Pageviews A Month, 25 Servers, And It's All About Performance
    开启Windows Server 2008 R2上帝模式
    微信支付实战(与支付宝和其他一些支付有些不一样)
  • 原文地址:https://www.cnblogs.com/joe235/p/12467757.html
Copyright © 2011-2022 走看看