Components:

  • Image path binding value, if static can be used.. / or @; /static/image/xxx. PNG is recommended for dynamic local paths. Otherwise, apps, h5, applets, and other platforms will definitely have problems
  • Mounted () specifies the life cycle of a vue component. If a customized component is used, the onload life cycle of a subcomponent is invalid
  • Applets do not allow the use of background images

Grammar:

  • Use v-show whenever possible, v-if can cause problems on the side of applets, and v-show can fail on child components in the way that applets use custom components. The solution is to use V-if or data in the data definition of the corresponding data graft to determine

Notes:

  • Determine whether the screen is banged (control placeholder, controlled by the returned Boolean value)

    / / conditional compilation, only on the app will perform / / # ifdef app - PLUS the console. The log (" judge whether Liu Haibing ", enclosing fit = PLUS. The navigator. HasNotchInScreen ()) / / # endifCopy the code
  • Obtain wechat small program capsule information (return capsule object information parameters)

    	// #ifdef MP-WEIXIN
    			this.wxMenuBtn = uni.getMenuButtonBoundingClientRect()
    		    // #endif
    Copy the code