前言:最近在用uni-app学习并开发一些小应用,
顺便记录下开发和学习过程中遇到的一些坑,方便以后避免
设置默认值的坑:需要在swiper上设置current
默认值才生效
完整代码:
<uni-swiper-dot :info="info" :current="current" field="content" :mode="mode">
<swiper class="swiper-box" @change="paperChange" :current="current">
<swiper-item v-for="(item ,index) in info" :key="index">
<view class="swiper-item">
<img class="paperImg" :src="item.cover_image" alt />
</view>
</swiper-item>
</swiper>
</uni-swiper-dot>
在page.json中的pages中添加 即可
{
"path": "pages/detail/detail",
"style": {
"app-plus": {
//app配置自定义导航
"titleNView": false //app禁止使用原生导航
}
}
},
在page.json中的pages中添加 即可
"path": "pages/detail/detail",
"style": {
"navigationStyle":"custom"
}
效果图在下面:图片的效果很好
我的博客即将同步至腾讯云开发者社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=3ojgb8gypwcg0