How to solve the problem that the bound data in the template of vue.js reports an error as `undefined`?

in < template > of the Vue.js project:

<td>{{data.name}}</td>

there is such insert data here, please tell me:

if data does not have name, an error will be reported here. Is there any way to give it a default value in the template?

for example: give an empty string if there is no name,.

is it stated in the official document that I can"t find it?

Mar.02,2021

try this: {{data.name? Data.name:''}


<td v-text="data.name?data.name:''"></td>

{{data.name | | 'default'}}

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-1bf6784-32017.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-1bf6784-32017.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?