1. The margin problem of Image component

This is a very common problem. Add display: block to the image; Or display: flex; Can be


2. Configure the domain name environment

Description: The development of our project requires dynamic switching experience and formal three environments

const env = {
    release: 'apiUrl1'./ / formal version
    trial: 'apiUrl2'./ / experience
    develop: 'apiUrl3' / / development version
}
export const baseUrl = env[__wxConfig.envVersion]
Copy the code

3.value below was evaluated just now

Description: I'm using uniApp, and I'm changing a complex array in computed through console.log and eval.


4. Failed to set a horn

Wx.settabbarbadge () cannot be called without tabBar


5. Hidden failure

  • Hidden controls display and hiding by changing display to see if the element CSS has a display attribute
  • Cannot be set on the block tag

6. Roll through

// WXML
 <view catchtouchmove="stopTouch"> Scroll layer </view>//JS
stopTouch(){return}
Copy the code

7. Cloud development payment callback executes repeatedly

Because the cloud function executed after payment does not return as required, the cloud function executed after payment callback returns as required

return {
    errcode: 0,
    errmsg: 'ok'
}
Copy the code

8. Input component placeholder add icon

First go to Ali iconFONT generate iconfont download into the project, the introduction of iconFONT

// some people refer to iconfont icon-xxx directly in placeholder-class. // uniapp <textarea class="input-area iconfont" style="font-size: 28rpx;" :placeholder=" '\ue612 <textarea class="input-area iconfont" style="font-size: 14px; 28rpx;" Placeholder ="{{placeholder}}" maxLength ="10" /> data: {{placeholder: '\ue612 '}Copy the code