Ant Design vue change the background color of the table

Before writing this article, I have been talking to the manager for a long time. The code I implemented was written into a document and copied to his computer to no effect. My own computer can realize the function. The code I wrote at the beginning did not have any effect, but suddenly it was fine, and it was possible to write it as it was. I didn't study to understand why. The effect can also be achieved after the code is submitted.

Use the rowClassName property to change the color of the row background:
table property

<a-table
        :rowClassName="rowClassName">

JS code:

methods: {
    
    
      rowClassName(record,index) {
    
    
        let a123 = "table-back"
           return a123;
        }
      },

Css:

<style>
    /deep/.table-back {
    
    
     background-color: yellow;
   }
</style>

Achieve results:
Insert picture description here
Note: It may not be successful! ! I wrote the code like this at the beginning, but it didn’t work, but it was realized suddenly, evil one B

Guess you like

Origin blog.csdn.net/sinat_33940108/article/details/112782074