The problem of ternary operator in curly braces

backstage, give me a judgment type_name is divided into car dealers and models, car models take car_title, car dealers take title. Could you tell me how to judge in curly braces?

this is what I wrote, and I will report an error:
<span class="person_name">{{item.type_name == ""item.title:item.type_name == "" ? item.car_title:""}}</span>
< H6 > this is the data returned by the background: < / H6 >
{
    "id": 3,
    "uid": 1,
    "type_id": 2,
    "relation_id": 1,
    "create_time": "20180425 21:40",
    "car_title": null,
    "car_content": null,
    "car_pic": null,
    "title": "",
    "type_name": ""
}
Mar.07,2021

  • Ternary operation expression
<span class="person_name">{{item.type_name == '' ? item.title : item.type_name == '' ? item.card_title : ''}}</span>
  • use v-if to judge
<span v-if="item.type_name == ''" class="person_name">{{item.car_title}}</span>
<span v-if="item.type_name == ''" class="person_name">{{item.title}}</span>
<span v-else class="person_name">''</span>
  • usage
<span class="person_name">{{getTitle(item)}}</span>

getTitle (data) {

if(data.type_name == ''){
    return data.title;
}else if(data.type_name == ''){
    return data.car_title;
}else{
    return '';
}

}


-sharp 
a == 1 ? true : false
<span class="person_name">{{item.type_name == '' ? item.title : (item.type_name == '' ? item.car_title : '')}}</span>

vue code is written like this, oh ~

  

the problem is described more clearly, which makes my skull ache. The layout is good, too.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f118-2b9ae.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f118-2b9ae.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?