Answer the question
In order to leave comments, you need to log in
Component method not working?
'use strict';
Vue.component('MainMenu', {
template: '#Main-menu',
methods: {
hover: function( id) {
console.log(id);
}
}
});
let application = new Vue({
el: '#application'
});
Answer the question
In order to leave comments, you need to log in
I found a solution, it turns out the problem was that the template wrapper cannot be nested in the application container
I think that it is not correct usage, you need to write a template for the component separately:
<script type="text/x-template" id="main-menu">
<p>Your template is here</p>
</script>
<div id="application">
<main-menu></main-menu>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question