效果图:
<a-descriptions-item label="治疗方式"> <a-form-model-item prop="treatments"> <template> <a-tree-select labelInValue v-model="otherFrom.treatments" show-search style=" 100%" :value="otherFrom.treatments" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treatmentData" placeholder="请选择治疗方式" allow-clear multiple tree-default-expand-all @change="onChange" @search="onSearch" @select="onSelect" > </a-tree-select> </template> </a-form-model-item> </a-descriptions-item>
方法: methods: { onChange(value, e) { console.log(value); for (let i = 0; i < value.length; i++) { value[i].label = value[i].value; } this.otherFrom.treatments = value; }, }