使用Vant UI的AddressEdit进行地址编辑时,本来是默认地址,但默认地址状态却不显示。
{
"errno": 0,
"errmsg": "\u6210\u529f",
"data": {
"id": 4,
"name": "\u67d0\u7532",
"userId": 1,
"province": "\u5317\u4eac\u5e02",
"city": "\u5e02\u8f96\u533a",
"county": "\u4e1c\u57ce\u533a",
"addressDetail": "\u4e1c\u76f4\u95e8\u75321\u53f7",
"areaCode": "110101",
"tel": "18812341234",
"isDefault": 1,
"addTime": "2021-10-20 09:03:32",
"updateTime": "2021-10-20 11:26:26",
"deleted": false
}
}
经过排查,发现是否默认地址,isDefault只接受布尔值true或false。于是将传递值进行了更改
{
"errno": 0,
"errmsg": "\u6210\u529f",
"data": {
"id": 4,
"name": "\u67d0\u7532",
"userId": 1,
"province": "\u5317\u4eac\u5e02",
"city": "\u5e02\u8f96\u533a",
"county": "\u4e1c\u57ce\u533a",
"addressDetail": "\u4e1c\u76f4\u95e8\u75321\u53f7",
"areaCode": "110101",
"tel": "18812341234",
"isDefault": true,
"addTime": "2021-10-20 09:03:32",
"updateTime": "2021-10-20 11:28:55",
"deleted": false
}
}
最终默认地址状态显示如下 :
总结:Vant UI AddressEdit默认地址字段isDefault只接受布尔true
或false
.