day04工作日-输入框轮播

80 阅读1分钟
<template>
  <div class="container">
    <el-carousel height="30px" direction="vertical" :autoplay="true" class="myswiper">
      <el-carousel-item v-for="(item, index) of msgList" :key="index">
        <div class="swiper-item">{{ item.title }}</div>
      </el-carousel-item>
  </el-carousel>
    <input type="text" :placeholder="placeholder">
  </div>
</template>
<script>
export default {
  name: 'Home',
  components: {
    
  },
  data () {
    return {
      swiperOptions: {
          pagination: {
            el: '.swiper-pagination',
            clickable: false,
          },
          autoplay: 2000,
          direction: "vertical",
          speed: 500,
          autoHeight: true,
         
          observer: true,//修改swiper自己或子元素时,自动初始化swiper 
          observeParents: true,//修改swiper的父元素时,自动初始化swiper 
          // Some Swiper option/callback...
        },
        msgList: [
          { title: "朋友圈" },
          { title: "文章" },
          { title: "公共号" },
          { title: "小程序" },
          { title: "音乐" },
          { title: "表情" },
          { title: "订阅号" }
        ],
        placeholder: ''
    }
  }
}
</script>
<style scoped lang="scss">
.container {
  width: 100%;
  height: 50px;
  line-height: 50px;
  position: relative;
  .myswiper {
    position: absolute;
    height: 40px;
    width: 100px;
    top:2px;
    left: 850px;
    z-index: 8;
    .swiper-item {
      widows: 100px;
      height: 40px;
      overflow: hidden;
    }
  }
}
</style>