📜  从 Axios .then vue.js 访问数据 - Javascript 代码示例

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

代码示例2


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,
  },
};