{"id":18983872,"url":"https://github.com/fattihkoca/vuejs-ajax","last_synced_at":"2025-04-19T20:12:42.640Z","repository":{"id":57394429,"uuid":"126643489","full_name":"fattihkoca/vuejs-ajax","owner":"fattihkoca","description":"It is a XHR plugin that works in specific features for Vue.js 2.x and and above versions. Supports file uploading, async \u0026 dynamic component plugins, HTML5 pushstate.","archived":false,"fork":false,"pushed_at":"2020-02-02T20:24:02.000Z","size":93,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T01:19:37.924Z","etag":null,"topics":["ajax","ajax-file-upload","component-shifter","dublicate-ajax-requests","jsonp","pushstate","vue","vue-dynamic-component","vue-plugin","vuejs","vuejs2"],"latest_commit_sha":null,"homepage":"https://fattihkoca.github.io/vuejs-ajax/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fattihkoca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"fattihkoca"}},"created_at":"2018-03-24T21:56:46.000Z","updated_at":"2022-08-25T22:31:06.000Z","dependencies_parsed_at":"2022-09-10T03:42:15.666Z","dependency_job_id":null,"html_url":"https://github.com/fattihkoca/vuejs-ajax","commit_stats":null,"previous_names":["fattihkoca/vue.ajax"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattihkoca%2Fvuejs-ajax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattihkoca%2Fvuejs-ajax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattihkoca%2Fvuejs-ajax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fattihkoca%2Fvuejs-ajax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fattihkoca","download_url":"https://codeload.github.com/fattihkoca/vuejs-ajax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223713800,"owners_count":17190558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","ajax-file-upload","component-shifter","dublicate-ajax-requests","jsonp","pushstate","vue","vue-dynamic-component","vue-plugin","vuejs","vuejs2"],"created_at":"2024-11-08T16:18:54.058Z","updated_at":"2024-11-08T16:18:56.436Z","avatar_url":"https://github.com/fattihkoca.png","language":"JavaScript","funding_links":["https://github.com/sponsors/fattihkoca"],"categories":[],"sub_categories":[],"readme":"![vuejs-ajax](https://user-images.githubusercontent.com/1655312/41012120-c9f6f6de-6948-11e8-8afa-582e33c2eb54.png)\n\n[![Travis Build](https://img.shields.io/travis/fattihkoca/vuejs-ajax.svg)](https://travis-ci.org/fattihkoca/vuejs-ajax)\n[![Version](https://img.shields.io/npm/v/vuejs-ajax.svg)](https://www.npmjs.com/package/vuejs-ajax)\n[![Downloads](https://img.shields.io/npm/dm/vuejs-ajax.svg)](https://www.npmjs.com/package/vuejs-ajax)\n\nIt is a XHR plugin that works in specific features for Vue.js 2.x and and above versions. It has many similar features with `jQuery`'s `ajax()` and `Angular`'s `$http()`.\n\nIt allows you to write more tidy code by solving many of the most common features used by developers in the core. **Here are a few examples**:\n\n#### Prevent Duplicate Requests\nOne of the most common problems is the problem of sending dublicate requests at the same time. Vue.js Ajax solve it easily. You can find more information [here](https://github.com/fattihkoca/vuejs-ajax/wiki/Prevent-Duplicate-Requests).\n\n#### File Uploading\nFile uploading with `Ajax` (`XMLHttpRequest`) can sometimes require you to write extra code. But it's very simple to do it with `Vue.js Ajax`. You can find more information [here](https://github.com/fattihkoca/vuejs-ajax/wiki/File-Uploading).\n\n#### History\nHistory feature to create a faster browsing experience. This means less elements to load and therefore faster browsing. But it's very simple to do it with `Vue.js Ajax`. There is a detailed explanation to [here](https://github.com/fattihkoca/vuejs-ajax/wiki/History).\n\n#### CSRF\nThis setting provides protection against CSRF attacks. You can find more information [here](https://github.com/fattihkoca/vuejs-ajax/wiki/CSRF).\n\n#### Component Shifter\nThere is also `Component Shifter` which solves a different task. With componentShifter() you can load (with `Vue.ajax`) and render your `Vue template` (html) in your application by dynamic \u0026 async `Vue.component()`. You can also add components and run them nested. You can find more information [here](https://github.com/fattihkoca/vuejs-ajax/wiki/Component-Shifter).\n\n***\n\n# Setup\n\n```npm\nnpm install vuejs-ajax --save\n```\n\n# Usage\n\n```javascript\n// ES6\nimport ajax from \"vuejs-ajax\"\nVue.use(ajax)\n\n// ES5\nvar ajax = require(\"vuejs-ajax\")\nVue.use(ajax)\n```\n\n***\n\n# Getting Started\nThe general shorthand version is as follows:\n\n```javascript\nVue.ajax.get(string url[, object data] [,object configurations])\n    .then(function success[, function error])\n```\n\n## Arguments\n\n| Property         | Required | Type             | Description                                                   |\n| ---------------- | -------- | ---------------- | ------------------------------------------------------------- |\n| url              | Yes      | String           | A string containing the URL to which the request is sent.     |\n| data             | No       | Object           | A plain object that is sent to the server with the request.   |\n| configurations   | No       | Object           | A set of key/value pairs that configure the Vue.ajax request. |\n\nAll of the above methods are a shorthand method of the `Vue.ajax()`: \n\n```javascript\nVue.ajax({\n    url: \"http://example.com\",\n    method: \"get\" // post, put, patch, delete, head, jsonp\n}).then(function(response) {\n    console.log(\"Success\", response.data)\n}, function(response) {\n    console.log(\"Error\", response.statusText)\n})\n```\n\nYou can find detailed information about the `Methods` [here](https://github.com/fattihkoca/vuejs-ajax/wiki/Methods).\n\n## Configurations\n\n| Configuration                                 | Type             | Default | Available                                  |\n| --------------------------------------------- | ---------------- | ------- | ------------------------------------------ |\n| [`assets`](https://github.com/fattihkoca/vuejs-ajax/wiki/Assets)                          | String Or Object | -       | -                                          |\n| [`async`](https://github.com/fattihkoca/vuejs-ajax/wiki/Asynchronous)                            | Boolean          | true    | true, false                                |\n| [`cache`](https://github.com/fattihkoca/vuejs-ajax/wiki/Cache)                            | Boolean          | false   | true, false                                |\n| [`complete`](https://github.com/fattihkoca/vuejs-ajax/wiki/Complete)                      | Function         | -       | -                                          |\n| [`csrf`](https://github.com/fattihkoca/vuejs-ajax/wiki/CSRF)                              | Boolean          | true    | true, false                                |\n| [`data`](https://github.com/fattihkoca/vuejs-ajax/wiki/Sending-With-Data)                              | Object           | -       | -                                          |\n| [`fileInputs`](https://github.com/fattihkoca/vuejs-ajax/wiki/File-Uploading)              | Element Object   | -       | Input file upload objects                  |\n| [`hardReloadOnError`](https://github.com/fattihkoca/vuejs-ajax/wiki/Hard-Reload) | Boolean          | false   | true, false                                |\n| [`history`](https://github.com/fattihkoca/vuejs-ajax/wiki/History)                        | Boolean          | false   | true, false                                |\n| [`headers`](https://github.com/fattihkoca/vuejs-ajax/wiki/HTTP-Headers)                        | Object           | -       | -                                          |\n| [`method`](https://github.com/fattihkoca/vuejs-ajax/wiki/Methods)                          | String           | get     | delete, get, head, jsonp, patch, post, put |\n| [`preventDuplicate`](https://github.com/fattihkoca/vuejs-ajax/wiki/Prevent-Duplicate-Requests)     | Boolean          | true    | true, false                                |\n| [`scrollTop`](https://github.com/fattihkoca/vuejs-ajax/wiki/Scroll-Top)                   | Boolean          | false   | true, false                                |\n| [`timeout`](https://github.com/fattihkoca/vuejs-ajax/wiki/Timeout)                        | Integer          | 60000   | Time in milliseconds                       |\n| [`title`](https://github.com/fattihkoca/vuejs-ajax/wiki/Title)                            | String           | -       | -                                          |\n| [`url`](https://github.com/fattihkoca/vuejs-ajax/wiki/Methods)                             | String           | -       | -                                          |\n| [`urlData`](https://github.com/fattihkoca/vuejs-ajax/wiki/Query-String)                       | Object           | -       | -                                          |\n| [`withCredentials`](https://github.com/fattihkoca/vuejs-ajax/wiki/With-Credentials)       | Boolean          | false   | true, false                                |\n\n***\n\n# License\n[MIT](https://github.com/fattihkoca/vuejs-ajax/blob/master/LICENSE)\n\nCopyright (c) 2019 [Fatih Koca](http://fattih.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffattihkoca%2Fvuejs-ajax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffattihkoca%2Fvuejs-ajax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffattihkoca%2Fvuejs-ajax/lists"}