天天看點

uni-app小程式開發記錄

前言:最近在用uni-app學習并開發一些小應用,

順便記錄下開發和學習過程中遇到的一些坑,友善以後避免

1.uni-swiper-dot 輪播圖

設定預設值的坑:需要在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>           

複制

2.APP取消頂部導航欄

在page.json中的pages中添加 即可

    {
      "path": "pages/detail/detail",
      "style": {
        "app-plus": {
          //app配置自定義導航
          "titleNView": false //app禁止使用原生導航
        }
      }
    },           

複制

3.小程式取消頂部的導覽列

在page.json中的pages中添加 即可

      "path": "pages/detail/detail",
      "style": {
      "navigationStyle":"custom"  
      }           

複制

效果圖在下面:圖檔的效果很好

uni-app小程式開發記錄

我的部落格即将同步至騰訊雲開發者社群,邀請大家一同入駐:https://cloud.tencent.com/developer/support-plan?invite_code=3ojgb8gypwcg0