Home  >  Article  >  Web Front-end  >  How uniapp determines the current environment

How uniapp determines the current environment

coldplay.xixi
coldplay.xixiOriginal
2020-12-09 14:31:165366browse

Uniapp’s method of determining the current environment: 1. To determine if it is Apple, the code is [uni.getSystemInfoSync().platform=='ios']; 2. To determine if it is Android, the code is [uni.getSystemInfoSync() .platform=andr].

How uniapp determines the current environment

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, Dell G3 computer.

Recommendation (free): uni-app development tutorial

How uniapp determines the current environment:

Judgment is Apple:

uni.getSystemInfoSync().platform == 'ios'

Android:

uni.getSystemInfoSync().platform === 'android'

Related free learning recommendations: Programming video

The above is the detailed content of How uniapp determines the current environment. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn