element-ui set of questions table style does not take effect

First look at the wording of vue default css

<style scoped>

<style>

In a vue components, style default scope is scoped, and elementUI in table style settings can not be scoped in, so the following is the approach:

A method to remove scoped

<style>
.el-table tr,
.el-table th,
.el-table td{
  background-color: rgba(204, 204, 204, .3);
}
<style>

The second method to add the global css styles

First establish a main.css

.el-table tr,
.el-table th,
.el-table td{
  background-color: rgba(204, 204, 204, .3);
}

Is then introduced in the head index.html

<link rel="stylesheet" href="./static/css/main.css">

Or add the following statements in main.js

import '../static/css/main.css'

Guess you like

Origin www.cnblogs.com/cnliang/p/11599309.html