0👍
On your <ul class="sub-menu">
element, include v-if
or v-show
with a test if the item contains any subItems (e.g. <ul class="sub-menu" v-show="hasSubItems">
once you’ve computed hasSubItems
of course). Check out conditional rendering in the Vue docs.
- [Vuejs]-[Vue warn]: Error in render: "TypeError: Cannot read property 'name' of undefined"
- [Vuejs]-Upload File to a ftp server in Vue.js
Source:stackexchange.com