0
頂部菜單/的script.js如何訪問屬性child Vue公司JS
module.exports = {
components: {
'topmenuSearch': require('vue').extend(require('./topmenu-search/component.vue'))
}
}
/topmenu/template.html
<div class="search-overlay" v-if="topmenuSearch.searching"></div>
/topmenu/topmenu-search/script.js
module.exports = {
data: function(){
return {
results: [],
searchValue: '',
searching: false
}
}
}
在控制檯我得到
build.js:3008 [Vue warn]: Error when evaluating expression "topmenuSearch.searching": TypeError: Cannot read property 'searching' of undefined (found in component: <topmenu>)
如何訪問topmenuSearch兒童,以便我可以做這件事?