在App.vue或者别的根节点页面中设置page的宽高为100%,别的页面就可以正常拿到父元素的高度,设置html、body为100%在uniapp中是没有效果的。
// App.vue或其他根页面
<script>
export default {
}
</script>
<style lang="scss">
page {
width: 100%;
height: 100%;
}
</style>
在App.vue或者别的根节点页面中设置page的宽高为100%,别的页面就可以正常拿到父元素的高度,设置html、body为100%在uniapp中是没有效果的。
// App.vue或其他根页面
<script>
export default {
}
</script>
<style lang="scss">
page {
width: 100%;
height: 100%;
}
</style>