方法有很多种
<el-button class="search_button" @click="search">查询</el-button> .search_button { color: #ffffff; background: #15ac86; border: none; border-radius: 3px; &:hover, &:active, &:focus { color: #ffffff; background: #15ac86; border: none; border-radius: 3px; } }
<el-input v-model="text" class="text-box"></el-input> <style lang="less" scoped> .text-box { /deep/ input { width: 166px; text-align: center; } }
</style>
除了样式穿透还可以新建一个没有 scoped 的 style(一个.vue文件允许多个style)。都可以
原文:https://www.cnblogs.com/xiaoliziaaa/p/13202644.html