elementPlus treeselect相关问题

html 复制代码
    <el-tree-select
      placeholder="请选择业务代码"
      :props="{ label: 'transactionName', value: 'transactionCode' }"
      v-model="item.transactionCode"
      node-key="id"
      :data="transactionList"
      :default-expanded-keys="[item.transactionCode]"
      :default-checked-keys="[item.transactionCode]"
      :filter-node-method="filterNodeMethod"
      @node-click="(data) => addSelect(data, index)"
      style="width: 320px"
      filterable
      default-expand-all
      highlight-current
      check-strictly
    >
      <template #default="{ data }">
        {{ data.transactionName }}
        <span style="color: gray; text-align: right">{{ data.transactionCode }}</span>
      </template>
    </el-tree-select>
1、后端返回树形结构不是label、value解决方法如下:
html 复制代码
 :props="{ label: 'transactionName', value: 'transactionCode' }"
2、获取到当前选中项的label信息:

@node-click="(data) => addSelect(data, index)"

javascript 复制代码
  let addSelect = (data, index) => {
    formModel.transactionInfo[index].transactionName = data.transactionName
  }
3、编辑、详情页面数据子集回显问题
javascript 复制代码
     :default-expanded-keys="[item.transactionCode]"
     :default-checked-keys="[item.transactionCode]"
相关推荐
李伟_Li慢慢2 分钟前
01-threejs架构原理-课程简介
前端·three.js
_瑞1 小时前
深入理解 iOS 渲染原理
前端·ios
IT_陈寒1 小时前
SpringBoot自动配置失灵?你可能忘了这个关键注解
前端·人工智能·后端
碎碎念_4921 小时前
SpringBoot + Vue 前后端分离从 0 到 1 完整环境配置流程
vue.js·spring boot·后端
iCOD3R2 小时前
Skill - kill-ai-slop 解决“AI 味”样式
前端·css·ai编程
shuaijie05182 小时前
强制修改调用接口的api地址。
javascript·vue.js·ecmascript
皮音2 小时前
Skill 在项目中的实践 —— 从 Agent 困境到 Skill 工程化
前端
大龄秃头程序员3 小时前
RN 0.86 新架构实战:TurboModule + Fabric 组件 + iOS 原生容器,完整代码开源
前端·react native
这是个栗子3 小时前
前端开发中的常用工具函数(八)
开发语言·前端·javascript
Hilaku3 小时前
Vue 和 React 真正的差距,不在语法,而在团队犯错成本
前端·javascript·程序员