vue-axios更改操作

复制代码
<template>
  <div class="nav">
    <label for="">新部门</label><input v-model="location" type="text" />
    <label for="">旧部门</label><input v-model="OldLocation" type="text" />
    <input @click="Updata()" value="更改" type="button" />
    <h4 v-if="font === 4">更改成功,但是不晓得你数据库有没有前置部门条件;</h4>
  </div>
</template>
<script>
import axios from "axios";
export default {
  name: "UpdateView",
  data() {
    return {
      location: [],
      OldLocation: [],
      font: [],
    };
  },

  methods: {
    Updata() {
      axios({
        // 请求方式
        method: "GET",
        // 请求地址
        url: `http://localhost:8086/Update`,
        // URL中的查询参数
        params: {
          location: this.location,
          OldLocation: this.OldLocation,
        },
      }).then((res) => {
        console.log(res);
        this.font = 4;
      });
    },
  },
};
</script>
<style>
label {
  font-size: 20px;
  font-weight: 700;
  margin-left: 10px;
  margin-right: 10px;
}

input {
  margin-left: 10px;
  margin-right: 10px;
}

.navs {
  margin-top: 10px;
}
.nav {
  border-top: 3px solid #ff8500;
  background-color: #fcfcfc;
  border-bottom: 1px solid #edeeed;
  line-height: 41px;
}
.nav a {
  display: inline-block;
  height: 41px;
  padding: 0px 10px;
  font-size: 15px;
  color: #4c4c4c;
  font-family: "微软雅黑";
  text-decoration: none;
}
.nav a:hover {
  background: #edeeed;
  color: #ff8500;
}
</style>
复制代码

 

posted @   しゅおく  阅读(59)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示