样式踩坑
1,el-table在scoped的style中设置样式无效,求解
- 给el-table(加了一个class="employee-table")每行的最后一个td加上text-align:right 样式
- 样式写在style scoped居然无效:
<style scoped lang="scss"> // 无效样式
.employee-table .el-table__body tr td:last-child{
.cell {
text-align: right !important;
}
}
</style>
- 样式写在没有scoped中的style就生效了!!!求解
<style lang="scss">// 有效样式
.employee-table .el-table__body tr td:last-child{
.cell {
text-align: right !important;
}
}
</style>
其他踩坑
1,项目开发过程中能在手机上访问
- 在package.json的
scripts dev
中添加 你的电脑ip的host,如图所示 - 添加后,重新运行即可生效
-
注意:添加后,本地电脑无法通过localhost访问了,也只能通过ip访问
image.png
-
网友评论