发表于: 2019-10-30 23:43:39

1 928


今天完成的事情:

1.今天设置给轮播图添加移动端的触摸事件,发现element的轮播图添加后失效,失效原因是overflow:hidden干扰,使得触摸事件无法在轮播图上起效,后来去找其他的组件,发现了有一个专门应用于vue移动端的组件库vant,里面有适合的触摸型轮播图:

<template>
  <div class="articleContent">
    <nav>
      <img src="../assets/images/热门推荐/u538.svg" alt class="navImgLeft" />
      <p class="navWord">搜索结果</p>
      <img src="../assets/images/首页-视频1/u10.svg" alt class="navImgRight" />
    </nav>
        <div class="keyWord">
         <span>年级选择</span>
      <img src="../assets/images/首页-视频1/u42.svg" alt />
      <input type="text" placeholder="请输入关键词" />
    </div>
    <van-swipe :autoplay="3000" :show-indicators="false">
  <van-swipe-item v-for="(imageindexin images" :key="index">
    <img :src="imageclass="image" />
  </van-swipe-item>
</van-swipe>
    <main>
      <router-view></router-view>
    </main>
    <footer>
      <div class="foot">
        <img src="../assets/images/首页-视频1/u15.svg" alt />
        <p>首页</p>
      </div>
      <div class="foot">
        <img src="../assets/images/首页-视频1/u20.svg" alt />
        <p>学习</p>
      </div>
      <div class="foot">
        <img src="../assets/images/首页-视频1/u19.svg" alt />
        <p>论坛</p>
      </div>
      <div class="foot">
        <img src="../assets/images/首页-视频1/u18.svg" alt />
        <p>我的</p>
      </div>
    </footer>
  </div>
</template>

<script>
export default {
  name: "articleContent",
  data() {
    return {
      page: null,
      images: [
        'https://img.yzcdn.cn/vant/apple-1.jpg',
        'https://img.yzcdn.cn/vant/apple-2.jpg'
      ]
       
    };
  },

};
</script>
<style lang="scss" >
.articleContent {
  nav {
    positionfixed;
    displayflex;
    justify-contentspace-between;
    align-itemscenter;
    top50px;
    width100%;
    height44px;
    background-color#f19c34;
    z-index10;
    .navImgLeft {
      margin-left10px;
    }
    .navImgRight {
      margin-right10px;
    }
  }
    .keyWord {
    positionrelative;
    margin-top80px;
    padding0 10px;
    img {
      positionabsolute;
      left80px;
      top50%;
      width20px;
      height14px;
      margin-top-7px;
    }
    input {
      
      width70%;
      height25px;
      padding-left22px;
      margin-right10px;
      font-size14px;
      border1px solid #aaa5a5;
      border-radius5px;
      outlinenone;
    }
  }
  .image{
    width100%;
    height200px;
  }
 

  footer {
    positionfixed;
    bottom0;
    height49px;
    displayflex;
    justify-contentspace-between;
    align-itemscenter;
    width90%;
    padding0 5%;
    background-color#e3e3e3;
    .foot {
      displayflex;
      flex-flowcolumn nowrap;
      justify-contentcenter;
      align-itemscenter;
      p {
        margin0;
        font-size12px;
      }
    }
  }
}
</style>


明天计划:

1.继续写前台页面。


返回列表 返回列表
评论

    分享到