一、css定义
1、css残留问题:在运行项目时,前一个页面的style会出现在新页面上,需要在每个style后面添加一个scoped
<style scoped>
</style>
2、css级联写法:lang="less"。如:
<style scoped lang="less">
.container {
width: 1220px;
.data-table {
width: 1200px;
margin-top: 20px;
margin-right: 20px;
font-size: 10px;
border-collapse: collapse;
td {
text-align: center;
padding: 5px 0;
}
td:nth-child(2) {
text-align: left;
}
.data-table-header {
color: white;
background: #538dd5;
line-height: 30px;
.td-table-name {
width: 10%;
}
}
}
}
.executor-model {
margin: 0px;
padding: 0px;
.add-btn {
font-size: 20px;
}
.user-mapping {
margin-bottom: 10px;
}
}
</style>
二、修改vue element自带样式:加上/deep/。可以f12找到组件的class样式,然后自定义修改。如:
.myinput /deep/ .el-input__inne