<template>
<div class="Insert">
<label for="name">名称:</label><input v-model="name" type="text" />
<label for="location">部门:</label><input v-model="location" type="text" />
<br />
<input value="增加" @click="Insert()" type="button" />
</div>
</template>
<script>
import axios from "axios";
export default {
name: "LoginView",
data() {
return {
name: "",
location: "",
};
},
methods: {
Insert() {
axios({
// 请求方式/
method: "POST",
// 请求地址
url: "http://localhost:8086/Insert",
data: {
name: this.name,
location: this.location,
},
})
},
},
};
</script>