From 70feeacca031b619226210aaac920737fec512ca Mon Sep 17 00:00:00 2001 From: Xenon Thong Date: Thu, 11 Apr 2019 14:22:01 +0800 Subject: [PATCH] - update README after axios implementation - fixed method declaration in README --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 074c087..e76b91b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ By [bubbleflat.com](https://bubbleflat.com) This package allow to display errors from laravel validation rules -! This package needs vue-resource to work ! +# Requirements +[Vue Resource](https://github.com/pagekit/vue-resource) or [Axios](https://github.com/axios/axios) # Installation @@ -56,12 +57,18 @@ export default { } }, - methods(){ + methods : { // Error are displayed if Laravel backend return 422 Http code with name as error - this.$http.post('/submit', {name: this.name}); + submit() { + // submit via vue resource + this.$http.post('/submit', {name: this.name}); + + // submit via axios + axios.post('/submit', {name: this.name}); + } } } -``` \ No newline at end of file +```