New Directory posts (read page)
Right-click on the directory new page
Directory structure is as follows:
In app.json, the adjustment of the posts for the page is displayed by default (this being the first, say after the specific multi-page)
{ "pages": [ "pages/posts/posts", "pages/welcome/welcome" ], "window": { "navigationBarBackgroundColor": "#405f80" }, "sitemapLocation": "sitemap.json" }
Official documentation found swiper components
posts.wxml
<!--pages/posts/posts.wxml--> <view> <swiper indicator-dots="true" interval="2000" autoplay="true"> <swiper-item><image src="/images/wx.png"></image></swiper-item> <swiper-item><image src="/images/vr.png"></image></swiper-item> <swiper-item><image src="/images/iqiyi.png"></image></swiper-item> </swiper> </view>
posts.wxss
Note that the size depends on the size of the carousel of FIG Swiper container, rather than the size swiper-item
/* pages/posts/posts.wxss */ swiper{ width:100%; height:500rpx; } swiper image{ width:100%; height:500rpx; }
Renderings: