element-ui树状table子节点和父节点区别开展示不同操作按钮


需求:在父节点(一级)展示【下载】按钮,子节点【二级】展示【查看】按钮

  table
                    :data="tableData"
                    style="width: 100%"
                    border
                    lazy
                    row-key="id"
                    :fit-columns="['name', 'lh_version']"
                    default-expand-all
            // child: 这是后台获取的数据中的子节点的名称! :tree
-props="{children: 'child', hasChildren: 'hasChildren'}" @selection-change="changeCheckBoxValue" max-height="550"> column type="selection" width="55"> column v-for="(option, index) in options" :label="option.label" :prop="option.name" :key="index" :width="option.width" :align="option.align" > column fixed="right" align="center" label="操作" width="360">