Vue element ui uses table custom column function to format time, how to solve the error?

I used a custom column in a table build using element ui. The fields are successfully bound. The code is as follows

 <el-table-column label="" align="center" sortable width="100">
     <template slot-scope="scope">
         {{ dateFormat(scope.row.profile.birthday,"yyyy-MM-dd" ) }}
     </template>
 </el-table-column>

but the following error occurs

There is no problem with the

clipboard.png

clipboard.png
function, because other times can be displayed normally and converted successfully. This error occurs only in the time of this profile object. Under what circumstances is it caused? Thank you for your answer

on how to solve the problem.

is it possible that there is no profile assignment in item at the beginning?


row.profile.birthday, should be the problem here.
when you are in create, your data should be: data: {profile:'',}, the attribute birthday cannot be found in data.
solution: the default data is: {profile: {birthday:''},}


Hello, landlord, you can try the following code:

  

try another way of thinking, try using a filter

Menu