I am currently working on a Vue
instance for a sidebar within my application that displays a list of menu items. In order to achieve this, I have created a local component with the following template structure:
template:'<div><li class="custom-erp-menu-list" v-on:click="toggleOpenChild">'+
'<a href="#">'+
'<span>'+
'<img src="assets/images/dollar-bills.svg" class="custom-erp-module-list-icon custom-erp-user-icons" width="18" height="18" alt="">'+
'</span>'+
'<span class="custom-erp-menu-parent">Purchase Order</span>'+
'</a>'+
'<ul class="nav custom-erp-menu-child-dropdown" id="purchase-order-child">'+
'<li><a href="page-profile.html" class="custom-erp-menu-child">Profile</a></li>'+
'<li><a href="page-login.html" class="custom-erp-menu-child">Login</a></li>'+
'<li><a href="page-lockscreen.html" class="custom-erp-menu-child">Lockscreen</a></li>'+
'</ul>'+
'</li></div>'
An issue has arisen where an error message is displayed stating that:
property or method "toggleOpenChild" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property
If you'd like to see a demonstration and explore further, you can visit the DEMO here.