当前位置:网站首页>[wechat applet development] (III) homepage banner component uses swiper
[wechat applet development] (III) homepage banner component uses swiper
2022-07-24 08:14:00 【Sock is a dog】
uniapp swiper The document uses the address https://uniapp.dcloud.io/component/swiper.html
Just use this part directly according to the document usage , Post homepage code ( No dependency can be used directly )
<template>
<view class="content">
<view>
<view class="uni-margin-wrap">
<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item>
<view class="swiper-item uni-bg-red">
<img src="https://boss-1251943848.cos.ap-beijing.myqcloud.com/20220318/5113e64691274f2a9dc2c93ec39447f2.jpg?imageMogr2/thumbnail/750x" alt="">
</view>
</swiper-item>
<swiper-item>
<view class="swiper-item uni-bg-red">
<img src="https://boss-1251943848.cos.ap-beijing.myqcloud.com/20220331/d3c4f0a138564ad6ab7d04df14062de7.jpg?imageMogr2/thumbnail/750x" alt="">
</view>
</swiper-item>
</swiper>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 1500
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.uni-margin-wrap {
width:690rpx;
width: 100%;
}
.swiper {
height: 114px;
margin: 15px;
border-radius: 4px;
overflow: hidden;
}
.swiper-item {
display: block;
height: 300rpx;
line-height: 300rpx;
text-align: center;
}
.swiper-list {
margin-top: 40rpx;
margin-bottom: 0;
}
.uni-common-mt{
margin-top:60rpx;
position:relative;
}
.info {
position: absolute;
right:20rpx;
}
.uni-padding-wrap {
width:550rpx;
padding:0 100rpx;
}
.swiper-item img {
width: 100%;
height: 100%;
display: block;
}
/* #ifdef APP-PLUS */
uni-swiper .uni-swiper-dot {
width: 10rpx;
height: 3rpx;
}
uni-swiper .uni-swiper-dot-active {
background-color: #000;
width: 40rpx;
border-radius: 5rpx;
}
/* #endif */
/* #ifdef MP-WEIXIN */
wx-swiper .wx-swiper-dot {
width: 20px;
height: 3px;
border-radius: 2px;
background: hsla(0,0%,100%,.4);;
}
wx-swiper .wx-swiper-dot-active {
background: #FFF;
}
</style>
The problem encountered is , There is no API Support Implementation requires the following two lines CSS And ensure CSS Is global rather than scoped
/* #ifdef MP-WEIXIN */
wx-swiper .wx-swiper-dot {
width: 20px;
height: 3px;
border-radius: 2px;
background: hsla(0,0%,100%,.4);;
}
wx-swiper .wx-swiper-dot-active {
background: #FFF;
}
Then you get the following page 
边栏推荐
- Introduction of some functions or methods in DGL Library
- 图新地球:如何导入修改了高程基准(椭球)的CAD文件
- P1135 strange elevator problem solution
- Poj3278 catch the cow
- Kubernetes: (I) basic concepts
- [shutter] the shutter doctor reports an error
- [linear algebra] deeply understand matrix multiplication, symmetric matrix, positive definite matrix
- [interview] Why do you need foreach with the for cycle?
- Is it safe to open an account online in Beijing
- Learning to track at 100 FPS with deep progression networks
猜你喜欢

Markdown basic grammar learning

Why is knowledge base important? This is the best answer I've ever heard
![[shutter] the shutter doctor reports an error](/img/09/20279b3ed71a18b28566ddbe212597.png)
[shutter] the shutter doctor reports an error

Qt|字符串生成二维码功能
![[Linux] Oracle VirtualBox installation CentOS 8](/img/fc/ea1070b93d3f1dbc52e60045834ea9.png)
[Linux] Oracle VirtualBox installation CentOS 8

Svg from entry to regret, why not learn it earlier (graphic version)

Super simple countdown code writing

Wechat payment V3 version of openresty implementation and pit avoidance Guide (service side)

Image feature Harris corner detection

Solve the problem that Anaconda navigator cannot be opened
随机推荐
SIFT feature point extraction
Do you want to have a robot that can make cartoon avatars in three steps?
Semantic slam: Probabilistic Data Association for semantic slam
Detailed explanation of wechat applet page configuration and sitemap configuration parameters
Introduction to webmethods
A knight's journey
Autojs article proficient in detailed explanation of autojs script tutorial
Poj3278 catch the cow
Shared lock, exclusive lock, mutex lock, pessimistic lock, optimistic lock, row lock, table lock, page lock, non repeatable read, lost modification, read dirty data
jmeter中JSON提取器使用
图的认识与存储
NFT概念究竟是怎么回事。。全面了解NFT市场、技术和案例
Decision tree - ID3, C4.5, cart
rbm 对比散度
[redis] how much do you know about bloom filter and cuckoo filter?
Project practice - document scanning OCR recognition
Figure New Earth: how the RVT format BIM model modeled by Revit can accurately match the map with texture
(dkby) DFL learning notes
P1739表达式括号匹配题解
Qt|字符串生成二维码功能