feat: about.vue 页面测试 __UNI_PLATFORM__
This commit is contained in:
parent
e3b6ad2c89
commit
965a87279a
@ -19,6 +19,11 @@
|
|||||||
<view class="text-center mt-8">
|
<view class="text-center mt-8">
|
||||||
<wd-button type="primary">wot 组件库测试</wd-button>
|
<wd-button type="primary">wot 组件库测试</wd-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="text-center py-4">
|
||||||
|
当前平台是:
|
||||||
|
<text class="text-red-500">{{ platform }}</text>
|
||||||
|
</view>
|
||||||
<view class="desc">测试设计稿样式</view>
|
<view class="desc">测试设计稿样式</view>
|
||||||
<view class="desc">设计稿是750px,css里面全部写rpx 即可</view>
|
<view class="desc">设计稿是750px,css里面全部写rpx 即可</view>
|
||||||
</view>
|
</view>
|
||||||
@ -27,6 +32,12 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
// 获取屏幕边界到安全区域距离
|
// 获取屏幕边界到安全区域距离
|
||||||
const { safeAreaInsets } = uni.getSystemInfoSync()
|
const { safeAreaInsets } = uni.getSystemInfoSync()
|
||||||
|
|
||||||
|
const platform = __UNI_PLATFORM__
|
||||||
|
const isH5 = __UNI_PLATFORM__ === 'h5'
|
||||||
|
const isApp = __UNI_PLATFORM__ === 'app'
|
||||||
|
const isMp = __UNI_PLATFORM__.startsWith('mp-')
|
||||||
|
console.log(platform, isH5, isApp, isMp)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -41,21 +41,12 @@
|
|||||||
</a>
|
</a>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="text-center py-4" v-if="isH5">当前平台是 - h5</view>
|
|
||||||
<view class="text-center py-4" v-else-if="isApp">当前平台是 - app</view>
|
|
||||||
<view class="text-center py-4" v-else>当前平台是 - {{ platform }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
// 获取屏幕边界到安全区域距离
|
// 获取屏幕边界到安全区域距离
|
||||||
const { safeAreaInsets } = uni.getSystemInfoSync()
|
const { safeAreaInsets } = uni.getSystemInfoSync()
|
||||||
const platform = __UNI_PLATFORM__
|
|
||||||
const isH5 = __UNI_PLATFORM__ === 'h5'
|
|
||||||
const isApp = __UNI_PLATFORM__ === 'app'
|
|
||||||
const isMP = __UNI_PLATFORM__.startsWith('mp-')
|
|
||||||
const isQuickApp = __UNI_PLATFORM__.startsWith('quickapp-')
|
|
||||||
|
|
||||||
const author = ref('菲鸽')
|
const author = ref('菲鸽')
|
||||||
const description = ref(
|
const description = ref(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user