2024年06月12日 建站教程
import Axios from './config' Axios.get('/user?id=1') .then(response => {}) .catch(error => {})
import Axios from './config' Axios.post('/user', { id: 1, name: 'user' }) .then(response => {}) .catch(error => {})
import Axios from './config' Axios.put('/user', { id: 1, name: 'user' }) .then(response => {}) .catch(error => {})
import Axios from './config' Axios.delete('/user?id=1') .then(response => {}) .catch(error => {})
PS:'./config'
代码,请查看《Vue中如何实现Axios封装》
本文链接:http://so.lmcjl.com/news/6411/