vue中,Element等外来组件的样式更改方法:
首先打开引用一个Element最简单的button按钮
<el-button type="primary">主要按钮</el-button>
然后打开运行打开浏览器F12打开调试器,像这样,
查看调试器对应组件的类名,就可以在对应vue文件中的style中修改了
<template>
<div class="hello">
<el-button type="primary">主要按钮el-button>
div>
template>
<script>
export default {
};
script>
<style>
.el-button {
background-color: red !important;
}
style>
!important;优先使用覆盖原生的组件的背景色。验证一下
步骤就是找到对应的类名然后修改。
原创©本文章为王孟旺原创,未经许可,禁止转载
0条评论