Support the ongoing development of Laravel.io →
posted 5 years ago

Hi there

I have got vue sort of working but it does not seem to react to events. For example: message displays perfectly well but toggle is not being set to false on click event?

component `<template>

<div id="app"> <h3>{{ message }}</h3> <button v-on:click="toggle = !toggle"> click here </button> <div v-show='toggle'>showing</div> </div> </template> <script> export default { data () { return { message: 'VUE is working', toggle: true } } } </script>`

app.js `require('./bootstrap');

window.Vue = require('vue');

Vue.component('test-component', require('./components/TestComponent.vue').default); Vue.component('example-component', require('./components/ExampleComponent.vue').default);

const app = new Vue({ el: '#app' });`

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Byron byronglendon Joined 29 Apr 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.