Last active
October 3, 2019 20:39
-
-
Save djpeach/b99388d0b42b7654cb49f62c1f328e11 to your computer and use it in GitHub Desktop.
Add sendRequest method to Vue component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods: { | |
sendRequest() { | |
client({ | |
method: 'get', | |
url: '/' | |
}).then((res) => { | |
this.response = res.data.message | |
}).catch((error) => { | |
this.response = error | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment