ishoulgodo
参考地址:  https://blog.csdn.net/weixin_42120767/article/details/107550236
在原生微信小程序中,我们可以设置page{background:#fff}来设置页面背景颜色,
如果你在uniapp上设置了不起作用,是因为标签上加了scoped, 那么如何使用scoped的同时又能设置page背景色

<style scoped></style>
当你去除后,你就会发现scope就能设置背景颜色了

但是有人可能会说。去除后,样式之间互相怎么办?
注意:有的人可能觉得<style>不加scoped会对其他页面产生影响,
其实不会(在vue里会,但是在小程序里不会),
设置的page只会对当前路径页面有用,对其它路径页面不产生影响

解决办法
<style>
   page{ background:red }
</style>
 
<style lang="scss" scoped>
   .home{
          xxx
    }
</style>

分类:

技术点:

相关文章:

  • 2021-12-07
  • 2021-12-13
  • 2023-03-31
  • 2021-09-27
  • 2022-12-23
  • 2021-07-05
  • 2023-03-31
  • 2021-11-26
猜你喜欢
  • 2022-01-01
  • 2021-11-26
  • 2021-04-14
  • 2021-07-25
  • 2022-01-01
  • 2022-12-23
  • 2021-11-21
相关资源
相似解决方案