解决办法一:
style去掉scoped
// 修改前
<style lang="scss" scoped>
page {
background-color: #f5f5f5;
}
</style>
// 修改后
<style lang="scss">
page {
background-color: #f5f5f5;
}
</style>
解决办法二:
为了避免页面的样式影响到其他页面,需要保留scoped。这时可以在另外一个没有scoped的style里配置页面背景色。
// 配置页面背景色
<style lang="scss">
page {
background: #f6f6f6;
}
</style>
// 页面的其他样式
<style lang="scss" scoped>
.filter-box {
background-color: #fff;
width: 750rpx;
height: 66rpx;
}
</style>
记录于2022-4-20