项目作者: code4mk

项目描述 :
:atom: Atom Axios snippet package
高级语言:
项目地址: git://github.com/code4mk/atom-axios.git
创建时间: 2017-08-31T18:45:40Z
项目社区:https://github.com/code4mk/atom-axios

开源协议:MIT License

下载


⚛️ Atom Axios {vue.js , laravel , js}

laravel-> vue ->axios atom package by @code4mk

Install:

  1. apm install atom-axios

Mian Features:

  • Snippet Axios on vue

Version:

  • axios 0.1.0

Snippet list

Snippet short Description
ax-g axios get all components
ax-gp axios get with params
ax-mg axios multiple get
ax-p axios post all components
ax-get axios only get
ax-then axios only then
ax-catch axios only catch
ax-bind this issue solve by bind

ax-g

  1. axios.get('/user?ID=12345')
  2. .then(function (response){
  3. // Getting Data from response
  4. })
  5. .catch(function (error){
  6. console.log(error);
  7. });

ax-gp

  1. axios.get('/user',{
  2. params:{
  3. ID: 12345
  4. }
  5. })
  6. .then(function (response){
  7. //Getting data from response
  8. })
  9. .catch( function (error){
  10. console.log(error);
  11. });

ax-mg

  1. function getUserAccount() {
  2. return axios.get('/user/12345');
  3. }
  4. function getUserPermissions() {
  5. return axios.get('/user/12345/permissions');
  6. }
  7. axios.all([getUserAccount(), getUserPermissions()])
  8. .then(axios.spread(function (acct, perms) {
  9. // Both requests are now complete
  10. }));

ax-p

  1. axios.post('/user',{
  2. firstName: 'code4mk',
  3. lastName: 'Hello-laravel'
  4. })
  5. .then(function (response){
  6. //Getting data from response
  7. })
  8. .catch( function (error){
  9. // Describe error!
  10. });

issue if can’t access by this . follow this

  1. axios.get('/user?ID=12345')
  2. .then(function (response){
  3. // Getting Data from response
  4. }.bind(this))
  5. .catch(function (error){
  6. console.log(error);
  7. });

Axios


@code4mk // ~ Hello Laravel