一、代码
<template>
<div>
<el-select
ref="selectTree"
v-model="form.Id"
filterable
placeholder="请选择"
>
<el-option
:key="form.Id"
:value="form.Id"
:label="form.label"
style="height: auto"
hidden
/>
<el-tree
ref="tree"
:data="data"
:props="defaultProps"
:node-key="defaultProps.value"
@node-click="handleNodeClick"
default-expand-all
/>
</el-select>
</div>
</template>
<script>
export default {
data() {
return {
data: [
{
Id: 1,
label: '一级 1',
children: [
{
Id: 11,
label: '二级 1-1',
childr