Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- export default {
- data(){
- return {
- form :{
- email:null,
- password:null
- }
- }
- },
- methods:{
- login(){
- User.login(this.form)
- }
- }
- }
- </script>
- class User {
- login(data){
- axios.post('/api/auth/login',data)
- .then(res => this.responseAfterLogin(res))
- .catch(error => console.log(error.response.data))
- }
- }
- export default User = new User();
- <script>
- export default {
- data(){
- return {
- form :{
- email:null,
- password:null
- }
- }
- },
- methods:{
- login(){
- axios.post('/api/auth/login',this.form)
- .then(res => console.log(res.data))
- .catch(error => console.log(error.response.data))
- }
- }
- }
- </script>
Add Comment
Please, Sign In to add comment