When map traverses the background data, when it is not added, how to judge that it is zero when it just comes up?

clipboard.png
is the location of span. How to make it display 0

without background data.
Mar.01,2021

assign an empty array of initial values to item.columns.

add: it looks like columns is an object with a count attribute. What is the purpose of this saving method? But it does not affect the usage, anyway, your item.columns needs an initial value, the initial item.columns.count is 0. To achieve anything, as long as you can determine whether the columns is the initial value.


is three yuan all right?

{item.columns.count?item.columns.count:0}

can you display this correctly?
if obj is like this, {columns.count:99}, write

{item["columns.count"]?item["columns.count"]:0}
Menu