enter code here
<template>
<div id="app">
<h1>Hello</h1>
<button @click="add"></button>
</div>
</template>
<script>
export default {
name: 'App',
data(){
return{
methods:{
add:function(){
alert("hello");
}
}
}
}
}
</script>
I'm new to Vue and I'm having trouble with methods/functions. This code is in a basic App.vue component - can anyone help me identify what I may be doing wrong?