Refer to the template below, how to add condition to make sure the menu
is not undefined
inside the v-for
attribute?
I've tried v-for="menu?item in menu.items:[]"
and v-for="item in menu?.items"
but neither works.
<div v-for="item in menu.items">{{item.text}}</div>