47 lines
874 B
Vue
47 lines
874 B
Vue
<template>
|
|
<view class="b-Bottom-Fit" :class="[Class]"></view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "b-Bottom-Fit",
|
|
data() {
|
|
return {
|
|
// Class: ''
|
|
};
|
|
},
|
|
computed:{
|
|
Class(){
|
|
// 获取系统信息
|
|
let system = uni.getSystemInfoSync();
|
|
console.log(system.platform, '设备类型');
|
|
if (system.platform === 'android' || system.platform === 'devtools') {
|
|
return 'Android';
|
|
} else if (system.platform === 'ios' || system.platform === 'devtools') {
|
|
return 'IOS';
|
|
}
|
|
}
|
|
},
|
|
mounted() {
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.b-Bottom-Fit {
|
|
width: 100%;
|
|
}
|
|
|
|
.Android {
|
|
padding-bottom: 32rpx;
|
|
box-sizing: content-box;
|
|
}
|
|
|
|
.IOS {
|
|
height: constant(safe-area-inset-bottom);
|
|
height: calc(env(safe-area-inset-bottom));
|
|
box-sizing: content-box;
|
|
}
|
|
</style>
|