The nav, I wrote with vue has a login button on it. After logging in, I want to change it into a logout button, rookie. I hope it would be better to have a demo, to thank all the bosses.

Mar.16,2021

There are many ways to implement

.
the first is to change the login word directly into logout
after a successful login. The second is that you write two buttons, log in and log out, and then render conditionally with v-if and v-else

.
<button v-if="!isLogin"></button>
<button v-else></button>

isLogin is a status value. After you log in successfully, you can directly assign it to true

.
Menu