增加页面
NoteAdd.vue
<template> <div> <el-form ref="form" :model="item" label-width="80px"> <el-form-item label="金额"> <el-input v-model="item.money"></el-input> </el-form-item> <el-form-item label="备注"> <el-input v-model="item.msg"></el-input> </el-form-item> <el-form-item label="日期"> <el-input v-model="item.date"></el-input> </el-form-item> <el-form-item> <el-button type="primary" @click="add">立即修改</el-button> </el-form-item> </el-form> </div> </template> <script> import axios from 'axios' export default { name:'NoteAdd', data() { return { item:{}, } }, methods:{ async add(){ await axios.post('http://localhost:9090/note',this.item) this.$router.push('/home') } } } </script> <style> </style>
标签:axios,methods,9090,家庭,item,记账,NoteAdd From: https://www.cnblogs.com/daniel350-wang/p/18036616