I have a Vue application with a navbar and some items:
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<a @click="test" class="navbar-item">
Home
</a>
<a @click="test" class="navbar-item">
Shopping
</a>
</div>
</div>
The test method looks like this:
const test = () => {
console.log("testt")
}
When I click one of the tags nothing happens in my browser console. I am using typescript as script language inside the Vue file and composition api. I also tried @click="asdf()"
but then I get the output that test is no function. Does somebody know which mistake I am making?
New contributor
Florian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1