1👍
The code that you have in your question works fine in this snippet. Feel free to play with this snippet, making it more like your problem code, until you are able to reproduce the problem.
new Vue({
el: 'body',
components: {
one: {
template: '#one-template',
data() {
return {
ride: {
user: {},
location: {},
type: {}
},
active: false
}
},
methods: {
delete() {
this.active = true;
}
}
}
}
});
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.min.js"></script>
<template id="one-template">
<button @click="delete">Delete</button>
{{active}}
</template>
<one></one>
-2👍
try this it might be helpful to you
data () {
return {
ride: { user: {}, location: {}, type: {} },
active: false
}
},
methods: {
delete ()
{
var vm = this ;
vm.active = false;
}
}
- [Vuejs]-Vue push unique values to a list
- [Vuejs]-Components are not loading while history mode in vue js in laravel
Source:stackexchange.com