<template>
<div class="login">
<input v-model="username" placeholder="账号">
<input v-model="password" placeholder="密码">
<button v-on:click="login">
登录
</button>
</div>
</template>
<script>
import axios from 'axios'
export default {
name:'LoginView',
data(){
return {
username:'',
password:''
}
},
methods: {
login(){
axios.post('http://localhost:8080/login',
{
username:this.username,
password:this.password,
}
).then(
response=>{
console.log("success",response.data)
}
)
}
}
}
</script>
<style>
</style>
简单登录框
最新推荐文章于 2024-11-01 13:37:40 发布