You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
337 B
12 lines
337 B
|
3 years ago
|
import platform from './platform';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @description: 判断 uni-app 当前运行环境
|
||
|
|
* @param {String|Array<String>} plat
|
||
|
|
* @return {Boolean}
|
||
|
|
* @example: checkPlatform('h5')
|
||
|
|
*/
|
||
|
|
export default function checkPlatform(plat = '') {
|
||
|
|
return (Array.isArray(plat) ? plat : [plat]).map(str => str.toLowerCase()).includes(platform);
|
||
|
|
}
|