1

I use Vue router for loading components in Laravel.I want to change 'show' value in instance variable when I click router-link.How can I do do this?

<router-link to="/login">Login</router-link>

Instance Variable:

const app = new Vue({
    el: '#app',
    data: function() {
        return {
            show: true
        }
    },
    router
});

Login Component :

<template>
  <div>Login component</div>
</template>

1 Answer 1

1

Something like this: <router-link to="/login" @click.native="show = false">Login</router-link>

Sign up to request clarification or add additional context in comments.

1 Comment

i solved this.the correct answer is @click.native="show".thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.