📜  axios 发布数据 vue js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:23.608000             🧑  作者: Mango

代码示例1


export default {
  name: 'formPost',
  data() {
    return {
      name: '',
      show: false,
    };
  },
  methods: {
   postNow() {
  axios.post('http://localhost:3030/api/new/post', {
    headers: {
      'Content-type': 'application/x-www-form-urlencoded',
    },
    body: this.name,
   });
  },
  components: {
    Headers,
    Footers,
  },
};