You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.2 KiB
68 lines
1.2 KiB
|
4 years ago
|
<template>
|
||
|
|
<view>
|
||
|
|
<view>
|
||
|
|
<swiper class="swiper-box" :autoplay="autoplay" :interval="interval" :duration="duration" :indicator-dots="indicatorDots">
|
||
|
|
<swiper-item v-for="(item, index) in background" :key="index">
|
||
|
|
<cover-image class="img" @click="linkTo()" src="/static/logo.png"></cover-image>
|
||
|
|
</swiper-item>
|
||
|
|
</swiper>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<view>
|
||
|
|
<uni-list v-for="(item, index) in user" :key="index">
|
||
|
|
<uni-list-item v-bind:title="item" clickable @click="getUser(item)"></uni-list-item>
|
||
|
|
</uni-list>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
background: ['1', '2', '3'],
|
||
|
|
autoplay: true,
|
||
|
|
interval: 2000,
|
||
|
|
duration: 500,
|
||
|
|
indicatorDots: true,
|
||
|
|
user:['Kim','Jim','Bob']
|
||
|
|
}
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
linkTo(){
|
||
|
|
uni.showModal({
|
||
|
|
content: '跳转啦',
|
||
|
|
showCancel: false
|
||
|
|
});
|
||
|
|
},
|
||
|
|
getUser(item){
|
||
|
|
console.log(item);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
.swiper-box {
|
||
|
|
height: 100px;
|
||
|
|
border: 2rpx solid #18BC37;
|
||
|
|
}
|
||
|
|
|
||
|
|
.swiper-item {
|
||
|
|
/* #ifndef APP-NVUE */
|
||
|
|
display: flex;
|
||
|
|
/* #endif */
|
||
|
|
flex-direction: column;
|
||
|
|
justify-content: center;
|
||
|
|
align-items: center;
|
||
|
|
height: 200px;
|
||
|
|
color: #fff;
|
||
|
|
}
|
||
|
|
|
||
|
|
.img {
|
||
|
|
position: absolute;
|
||
|
|
width: 100%;
|
||
|
|
height: 100%;
|
||
|
|
}
|
||
|
|
</style>
|