el-autocomplete 修改預設值value的欄位名
阿新 • • 發佈:2021-01-15
技術標籤:問題記錄
修改之前
<el-autocomplete
v-model="areaName"
:fetch-suggestions="queryAreaSearchAsync"
placeholder="請輸入區域名稱"
@select="handleSelect" >
</el-autocomplete>
把 value 改成 name:
<el-autocomplete
v-model="areaName"
:fetch-suggestions="queryAreaSearchAsync"
placeholder="請輸入區域名稱"
@select="handleSelect"
>
<template slot-scope="{ item }">
<div class="name" style="color:green">{{ item.value = item.name }}</div>
</template>
</el-autocomplete>
直需要改下面的紅圈