当前位置:网站首页>[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 
边栏推荐
- When does MySQL use table locks and row locks?
- Zhouzhihua machine learning watermelon book chapter 2 model evaluation and selection - accuracy and model generalization evaluation method, self-help method and integrated learning
- P1135 奇怪的电梯题解
- 【MATLAB】(四)MATLAB在线性代数中的应用
- 生成模型与判别模型
- 图新地球:Revit建模的rvt格式BIM模型如何带着纹理精准匹配地图
- Figure New Earth: how to import CAD files with modified elevation datum (ellipsoid)
- MySQL 啥时候用表锁,啥时候用行锁?
- P1305新二叉树题解
- 33 introduction to sparksql, dataframe and dataset
猜你喜欢

Project practice - document scanning OCR recognition

Robert operator, Sobel operator, Laplace operator

Kubernetes:(一)基本概念
![[shutter] the shutter doctor reports an error](/img/09/20279b3ed71a18b28566ddbe212597.png)
[shutter] the shutter doctor reports an error

Kotlin coprocess analysis (III) -- understanding the context of coprocess

33-SparkSql的介绍、DataFrame和DataSet

13. Unity2d horizontal version of two-way platform that can move up, down, left and right (two-way walking + movable + independent judgment) + random platform generation

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

Kotlin higher order function & DSL layout persuasion Guide
![[MySQL] installation tutorial and master-slave configuration](/img/79/0ad3f68b69a0a03a62422d4cc70035.png)
[MySQL] installation tutorial and master-slave configuration
随机推荐
Opencv project practice - credit card recognition
Wechat applet file types and functions
P1305 new binary tree solution
Super simple countdown code writing
SVG 从入门到后悔,怎么不早点学起来(图解版)
Intelligent robots and intelligent systems (Professor Zheng Zheng of Dalian University of Technology) -- 2. Mobile Robot Perception
Case practice - panoramic image mosaic: feature matching method
[Beijiao] image processing: basic concepts, image enhancement, morphological processing, image segmentation
Thesis reading: geotransformer
Learning dynamic Siamese network for visual object tracking full text translation
MySQL --- 子查询 - 标量子查询
nacos报错: ERROR Nacos failed to start, please see D:\nacos\logs\nacos.log for more details.
Database system - Basic Concepts
33-SparkSql的介绍、DataFrame和DataSet
图新地球:Revit建模的rvt格式BIM模型如何带着纹理精准匹配地图
Common DOS commands
Markdown basic grammar learning
WXS syntax reference -wxs module
Why is knowledge base important? This is the best answer I've ever heard
Code=6 'The connection has timed out unexpectedly