0👍
You are trying to trigger updateData
method, which is accessible only inside the HTML element that Vue is mounted on. I assume you are mounting Vue to the element with id="app"
.
You have to put the button inside the <div id="app">
:
<div id="app">
<button @click="updateData()">Button</button>
...
Or, if you don’t need to access any Vue properties, you can just create a function inside script
and trigger it with onclick
event. Keep in mind that @click
is also not accessible outside of Vue:
<button onclick="updateData()">Button</button>
<div id="app">
...
<script>
function updateData() {
console.log('test')
}
</script>
- [Vuejs]-How to merge two column which have same value into one column given they are sharing the similar product id?
- [Vuejs]-Post and get on Index controller laravel
Source:stackexchange.com