page.json的代码
{
"pages": [{
"path": "pages/index/index",
"style": {
"app-plus": {
"titleNView": false, //不显示导航栏
"statusbar": {
"background": "#fff"
}
}
}
}],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "APP",
"navigationBarBackgroundColor": "#fff",
"backgroundColor": "#fff",
"app-plus": {
"background": "#fff"
}
}
}
index.vue的代码
<template>
<div class="container">
<iframe :src="url" class="webView"></iframe>
</div>
</template>
<script>
export default {
data() {
return {
url: 'https://sobut.cn/test.html'
}
},
methods: {
}
}
</script>
<style>
* {
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
.container {
width: 100%;
height: 100%;
position: relative;
padding-top: var(--status-bar-height);
}
.webView {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: none;
}
uni-page-wrapper, uni-page-body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
</style>
青弦墨韵 (作者)
试过,无效
2022-06-27 15:26