当前位置:首页 > 微信 > 正文

工作遇到的问题之 -- mpvue写小程序

11-26 微信

标签:exe   ima   如何   put   微信小程序   return   ant   port   fill   

如何使用mpvue做小程序,引入公共的common.css

随意在目录下建一个common.css文件,然后再App.vue中以import的形式 引入;

   技术图片  ====》App.vue中技术图片

 

 实现轮播图

使用微信小程序默认的swiper

swiper组件
使用的页面和vue引入组件一样 
<template>
    <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" :circular="circular">
        <block v-for="(item, index) in images" :key="index">
            <swiper-item>
                <image :src="item.url" class="slide-image" mode="aspectFill"/>
            </swiper-item>
        </block>
    </swiper> 
</template>

<script>
export default {
  props: {
    images: {
      type: Array
    }
  },
  data() {
    return {
      indicatorDots: true,
      autoplay: true,
      circular:true,
      interval: 3000,
      duration: 500
    };
  }
};
</script>

<style scoped>
.swiper {
  height: 376rpx !important;
}
image {
  height: 100%;
  width: 100%;
}
</style>

  

  html:<Swiper :images="info.image" />
 
 export default{ components: {Swiper},}

工作遇到的问题之 -- mpvue写小程序

标签:exe   ima   如何   put   微信小程序   return   ant   port   fill   

温馨提示: 本文由杰米博客推荐,转载请保留链接: https://www.jmwww.net/weixin/15967.html

博客主人杰米WWW
杰米博客,为大家提供seo以及it方面技巧喜欢的朋友收藏哦!
  • 11365文章总数
  • 2266822访问次数
  • 建站天数
  • 头条文章

    图文推荐

    站长推荐

    友情链接