typescript manual

这里写目录标题

    • function
      • Named function
      • anonymous function
    • Axios
      • 经典片段

function

Named function

function add(x: number, y: number): number {
  return x + y;
}

anonymous function

let myAdd = function (x: number, y: number): number {
  return x + y;
};

Axios

经典片段

 const ax = axios.create({
  baseURL: 'yourbaseUrl',
  withCredentials: true,
});

const loginUser = () => { const body ={username:state.values.email, password:state.values.password};
ax.post('/login',body).then(function(response){
return response}).then().catch(error => console.log(error));}

你可能感兴趣的:(Script,typescript)