<el-table :data="tableData">
<el-table-column prop="name"></el-table-column>
</el-table>
tableData [{
name: 'irene'
}]
nameVariable is a variable, value is equal to 'name', when I change the column to <el-table-column :prop="nameVariable"></el-table-column>, the data is not displayed Yes, why is this?
The principle of this component is like this
: data is equivalent to a variable
prop is equivalent to the key of the variable
prop must be: the key of the data variable
So your problem should be a calling problem, prop cannot call other variables
For this question, please take a look at the demo on the official website
<el-table :data="tableData" style="width: 100%">
</el-table>
export default {
If you changed it at the top, you should change it at the bottom too