二级分类与一级分类的文字没有对齐
<el-table
:data="templateStore.hangyeList"
style="width: 100%"
row-key="id"
:tree-props="{ children: 'subData', hasChildren: 'hasChildren' }"
>
<el-table-column prop="industryCode" label="选项编码" width="80px" />
<el-table-column type="index" label="排序" width="100px" />
<el-table-column prop="name" label="选项名称" />
<el-table-column prop="isEnable" label="是否启用" width="100px">
<template #default="{ row }">
<span>{{ row.isEnable ? '是' : '否' }}</span>
</template>
</el-table-column>
<el-table-column prop="createdTime" label="创建时间" />
<el-table-column label="操作" width="300">
<template #default="{ row }">
<div>
<el-button
type="link"
v-if="!row.parentId"
@click="addclasshandle(row)"
size="small"
>新增二级分类模块
</el-button>
<el-button type="link" @click="Edit(row)" size="small">编辑
</el-button>
<el-button type="link" @click="del(row)" size="small">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
解决方法:
在第一列中添加右对齐即可: align="right"
<el-table-column
align="right"
prop="industryCode"
label="选项编码"
width="80px"
/>