需求:el-table通过内容的多少,自动撑开表格宽度
思路:可以通过af-table-column插件来解决
1.安装插件
npm i af-table-column
yarn add af-table-column
2.element table自适应列宽(main.js配置)
import AFTableColumn from 'af-table-column'
Vue.use(AFTableColumn)
3.使用(将el换成af)
<af-table-column prop="proType" label="商品类型" />