0
Declare the function like this
//apiCallUtility.js
export const registerUser=(first_name, last_name, email_address, password)=>{
return API().post('/api/register')
}
In the vue component import it
import {registerUser} from "relative path for apiCallUtility.js"
//and then use it as a function
Source:stackexchange.com