fuint-uniapp-master/components/page/banner/index.vue
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<template>
<view class="diy-banner" :style="{ height: `${imgHeights[imgCurrent]}rpx` }">
<!-- 图片轮播 -->
<swiper :autoplay="autoplay" class="swiper-box" :duration="duration" :circular="true" :interval="itemStyle.interval * 1000"
@change="_bindChange">
<swiper-item v-for="(dataItem, index) in dataList" :key="index">
<image mode="widthFix" class="slide-image" :src="dataItem.image" @click="onLink(dataItem.url)"
@load="_imagesHeight" />
</swiper-item>
</swiper>
<!-- 指示点 -->
<view class="indicator-dots" :class="itemStyle.btnShape">
<view class="dots-item" :class="{ active: imgCurrent == index }" :style="{ backgroundColor: itemStyle.btnColor }"
v-for="(dataItem, index) in dataList" :key="index"></view>
</view>
</view>
</template>
<script>
import mixin from '../mixin'
export default {
name: "Banner",
/**
* 组件的属性列表
* 用于组件自定义设置
*/
props: {
itemIndex: String,
itemStyle: Object,
params: Object,
dataList: Array
},
mixins: [mixin],
/**
* 私有数据,组件的初始数据
* 可用于模版渲染
*/
data() {
return {
indicatorDots: false, // 是否显示面板指示点
autoplay: false, // 是否自动切换
duration: 800, // 滑动动画时长
imgHeights: [], // 图片的高度
imgCurrent: 0, // 当前banne所在滑块指针
}
},
/**
* 组件的方法列表
* 更新属性和数据的方法与更新页面数据的方法类似
*/
methods: {
onLink(linkObj) {
this.$navTo(linkObj)
},
/**
后面还有 98 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。