While attempting to create a dynamic navbar, I encountered an issue. The goal was to have the navbar switch from displaying "login" and "register" when a session is logged in, to showing "profile" and "logout". The buttons for login and register were functioning correctly but when changing them using innerHTML in JavaScript, they no longer triggered the v-on:click function.
var nav_auth = document.getElementById("nav_auth");
nav_auth.innerHTML = `
<li class="nav-item">
<a class="nav-link" href="?profile"><i class="fas fa-user-circle user-circle-icon"></i> ` +
this.user.name +
`</a>
</li>
<li class="nav-item">
<a class="nav-link" href="?logout" v-on:click="logout()"> Logout </a>
</li>`;