G
G
guerrrka2018-10-07 15:55:41
Vue.js
guerrrka, 2018-10-07 15:55:41

How to do this on routes (vue)?

Help, just don't throw your slippers.
Made a login/registration using this tutorial .
App.vue has this thing:

<div v-if="alert.message" :class="`alert ${alert.type}`">{{alert.message}}</div>

(displays errors, for example, the password is not correct, etc.).
How to transfer this code to RegisterPage and loginPage? Or how to make a separate Auth.vue, which will have a template from App.vue
<div class="jumbotron">
        <div class="container">
            <div class="row">
                <div class="col-sm-6 offset-sm-3">
                    <div v-if="alert.message" :class="`alert ${alert.type}`">{{alert.message}}</div>
                    <router-view></router-view>
                </div>
            </div>
        </div>
    </div>

and will connect Login/RegisterPage.vue instead?
Now in LoginPage (RegisterPage) {{ alert }} is not available and displays an error

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question