
<v-btn text @click="logout">
<span class="mr-2">LogOut</span>
<v-icon>mdi-open-in-new</v-icon>
</v-btn>
export default {
methods:{
async logout(){
await this.$http.get('/logout');
this.$router.push("/login")
}
}
}

本文介绍如何在使用Vue.js开发中实现点击退出登录的功能,通过GET请求调用API,然后跳转到登录页面。

<v-btn text @click="logout">
<span class="mr-2">LogOut</span>
<v-icon>mdi-open-in-new</v-icon>
</v-btn>
export default {
methods:{
async logout(){
await this.$http.get('/logout');
this.$router.push("/login")
}
}
}

998
961

被折叠的 条评论
为什么被折叠?