You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
<template> |
|
<h1>登录页</h1> |
|
<button @click="login">点击登录</button> |
|
</template> |
|
|
|
<script setup lang="ts"> |
|
import { useRouter } from "vue-router"; |
|
const { replace } = useRouter(); |
|
|
|
const login = () => { |
|
localStorage.setItem("token", "1111"); |
|
replace({ |
|
name: "User", |
|
}); |
|
}; |
|
</script>
|
|
|