Skip to content
发表于
更新于
字数
阅读量

treeselect 树选择器 相关问题

默认显示 null 问题解决

  1. 将默认值修改为 null
  2. 在 normalizer 中删除空 children
javascript
/** 转换商品信息数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.id,
        label: node.label,
        children: node.children,
      };
    },
<el-table-column></el-table-column> 中使用被遮挡问题

需要设置 z-index

html
 <el-table-column
    label="产品名称"
    prop="productName"
    width="300"
    align="center">
    <template slot-scope="scope">
      <treeselect
        v-model="scope.row.productId"
        :options="productOptions"
        :show-count="true"
        z-index="999999"
        :appendToBody="true"
        :normalizer="normalizer"
        @input="changeProdcutId(scope.row)"
        placeholder="请选择产品"/>
    </template>
</el-table-column>