According to the use of the framework ruoyi-vue (front-end and back-end version) dictionary

16452841:

display effect:

 The actual value of the status is 1, which is defined in the dictionary management in the lecturer review.

Steps: first define the dictionary in ruoyi's dictionary management

dictionary management 

Then set the value you need according to the dictionary

After setting the value, the data of the front-end table is echoed

Here we first open our front-end vue project, we need to echo the vue file corresponding to the page

Add the dictionary dicts we just defined in the export default: ['the dictionary type we defined']

Then in the table, you need to set the corresponding value as the dictionary to be displayed, and use the following operations to complete the data display

 <el-table-column label="状态" align="center" prop="state" >
                  <template slot-scope="scope">
                    <dict-tag
                      :options="dict.type.leave_state"
                      :value="scope.row.state"
                    >
                    </dict-tag>
                  </template>
  </el-table-column>

 After completion, it can be displayed after refreshing the page

 

Guess you like

Origin blog.csdn.net/SiTiATech/article/details/128750068