What should I do if the small program written by uniapp is converted to app if there is code incompatibility

Cross-terminal compatibility | uni-app official website

This article only deals with the transfer of the current code to the App after the uniapp develops the applet. I don’t know how to convert the native applet to the app, and I don’t have a specific understanding.

Conditional compilation when a component needs to be modified

<!-- #ifdef MP-WEIXIN -->
	<official-account></official-account>
<!-- #endif -->

 

 API conditional compilation

// #ifdef  APP-PLUS
平台特有的API实现
// #endif

 Only run on the app (add MP-WEIXIN after #ifdef to display only on the applet, and so on, it is not a problem to compile and write pictures based on conditions)

 

 style conditional compilation

/*  #ifdef MP-WEIXIN  */
平台特有样式
/*  #endif  */

 Note that the style conditional compilation here no longer starts with //#ifdef! ! !

 

 The back of the official website has not been personally tested, you need to practice it yourself

Guess you like

Origin blog.csdn.net/maowencai/article/details/128655879