starwork-uniapp/src/utils/platform.ts

12 lines
271 B
TypeScript
Raw Normal View History

2024-12-31 10:05:55 +08:00
export const platform = __UNI_PLATFORM__
export const isH5 = __UNI_PLATFORM__ === 'h5'
export const isApp = __UNI_PLATFORM__ === 'app'
export const isMp = __UNI_PLATFORM__.startsWith('mp-')
const PLATFORM = {
platform,
isH5,
isApp,
2024-12-31 10:19:20 +08:00
isMp
2024-12-31 10:05:55 +08:00
}
export default PLATFORM