背景:
我正在做一个uniapp的表单,但是出现了easycom组件的不起作用,并且css样式也不起作用,
<template>
<view class="container">
<view class="header">
<view class="title">学生信息</view>
</view>
<view class="main"></view>
<view class="footer"></view>
</view>
</template>
<style scoped>
.container {
height: 100vh;
}
.header {
font-size: 20px;
background-color: aqua;
text-align: center;
}
.main {
text-align: center;
}
.footer {}
</style>
场景复现:
我给main加了背景颜色,一点都不显示,网上搜了很多,没有任何办法,大概是按照官网重新安装了一下,然后更新了一下小程序,最后还是不行。心态崩了。
方法:
最终是我通过命令行启动小程序的时候看见uniapp需要更新,我试了一下,结果一更新就好了。
npx @dcloudio/uvm@latest
更新命令如上,如果你忘了可以直接用