小程序入門會遇到的一些問題

tabBar不顯示問題

歡迎頁是pages/index/index,但list的第一項不是pages/index/index就會tabBar不顯示

"pages":[
    "pages/index/index",
    "pages/reserve/index",
    "pages/take/index",
    "pages/record/index",
    "pages/logs/logs"
  ],
"tabBar": {
    "list": [{
      "pagePath": "pages/reserve/index",
      "text": "預約",
      "iconPath": "icons/reserve_index.png",
      "selectedIconPath": "icons/reserve_index.png"
    },{
      "pagePath": "pages/take/index",
      "text": "取號",
      "iconPath": "icons/take_index.png",
      "selectedIconPath": "icons/take_index.png"
    },{
      "pagePath": "pages/record/index",
      "text": "預約歷史",
      "iconPath": "icons/record_index.png",
      "selectedIconPath": "icons/record_index.png"
    }]

IView的button組件無法綁定submit事件

<view>
  <form bindsubmit="formSubmit">
    <i-panel title="預約信息">
      <i-input value="{{ IDcard }}" name="IDcard" type="number" title="身份證號" mode="wrapped" placeholder="請輸入身份證號" />
      <i-input value="{{ phone }}" name="phone" type="number" title="聯繫電話" mode="wrapped" placeholder="請輸入手機號" />
      <i-input value="{{ phone }}" name="reserveTime" type="number" title="預約時間" mode="wrapped" placeholder="如2020-06-05 15:30" />
    </i-panel>
    <i-button formType="submit" type="info" shape="circle">提交</i-button>
    <!-- <button form-type="submit" type="info" shape="circle">提交></button> -->
  </form>
</view>

第8行是iView中的組件按鈕,點擊的時候無法提交表單。所以如果要用表單那就別用iView中的組件按鈕

iView的輸入框無法輸入

網上比較多的一種說法是獲取不到焦點,但是1.0.0的版本已經修復了這個問題,所以還是輸入不了的話,檢查是不是引入了iView的輸入框

<i-input value="{{ value2 }}" title="姓名" autofocus placeholder="請輸入用戶姓名" maxlength="100"/>

要加個maxlength纔行

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章