<template>
<view class="container">
<view v-if="isIOS">这是苹果系统的内容</view>
<view v-else>这是安卓系统的内容</view>
</view>
</template>
<script>
export default {
data() {
return {
isIOS: false
};
},
onLoad() {
this.getSystemInfo();
},
methods: {
getSystemInfo() {
uni.getSystemInfo({
success: (res) => {
this.isIOS = res.platform === 'ios';
}
});
}
}
};
</script>
<style>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
</style>