<template>
<view class="bg">...</view>
</template>
<style>
.bg {
position: fixed;
top: 0;
left: 0;
right: 0%;
bottom: 0;
background: linear-gradient(to bottom,#FFE2E8,#F4F4F4);
z-index: -1;
}
</style>
单独设置页面的背景颜色
/* 在style后面再多加一个style */
<style>
...
</style>
<style>
page {
background-color: #F9F9F9;
}
</style>