2.6.2 • Published 7 months ago

nucleo-quasar v2.6.2

Weekly downloads
65
License
MIT
Repository
github
Last release
7 months ago

nucleo-quasar

Base configurations for Quasar projects

Installation

npm install nucleo-quasar --save
yarn add nucleo-quasar

You can import the library and use as a Vue plugin to enable the functionality globally on all components.

import Vue from 'vue'
import { NucleoQuasar, Msg } from 'nucleo-quasar'

Vue.use(NucleoQuasar, options)

Configuration Options

These are the configuration options for everything to work.

{
  api: {
    // `hostDev` is the URL of the server that will be used for requests in development mode
    hostDev: 'http://localhost:3000/api',
    // `hostProd` is the URL of the server that will be used for requests in production mode
    hostProd: 'https://api.maisdiarias.com/api',
    // `path` is a complementary path for requests
    path: {
      // site
      site: '/site',
      status: '/status'
    },
    // Function to be called when a request responds with 404 status
    // this is optional
    notFoundFn () {
      Msg('Rota indisponível', false)
    },
    // Function to be called when a request responds with 401 status
    // this is optional
    unauthorizedFn () {
      Msg('Acesso expirado', false)
    },
    // Function to be called by LoginToken
    // this is optional
    loginFn (resolve, reject, token) {
      console.log('loginFn', token)
    }
  },
  // Options of the Quasar Dialog used in Alert
  alert: {
    position: 'left',
    style: { backgroundColor: '#F0f0f0', color: '#404040' },
    ok: { textColor: 'white', color: 'accent' },
    cancel: { textColor: 'white', color: 'negative' }
  },
  // Options of the Quasar Dialog used in Delete
  // what not to change will be used as an `alert`
  delete: {}
}

nucleo-quasar API

Request methods allowed.

api.get(path, options)
api.post(path, data, options)
api.put(path, data, options)
api.delete(path, data, options)

Methods Options

{
  // Set to 'true', the Authorization header will be inserted
  token: true,
  // Set to 'null' a 'response.data.message' message will be displayed using Msg
  // Set to 'true' will be returned reject on Promise
  // Set to 'false' console.error will be returned
  error: null,
  // Set to 'true', Quasar Loading will be used
  loading: true
}

nucleo-quasar Msg

Vue prototype $Msg.

import { Msg } from 'nucleo-quasar'

Msg(message, type, options)

nucleo-quasar Alert

Vue prototype $Alert.

import { alert } from 'nucleo-quasar'

alert(title, message, options)

nucleo-quasar Delete

Vue prototype $Delete.

import { delet } from 'nucleo-quasar'

delet(name, controller, data)
  .then(data => ...)

Credits

License

MIT

2.6.1

7 months ago

2.6.2

7 months ago

2.5.99

7 months ago

2.5.98

10 months ago

2.5.96

11 months ago

2.5.97

11 months ago

2.5.91

1 year ago

2.5.92

1 year ago

2.5.93

1 year ago

2.5.6

1 year ago

2.5.8

1 year ago

2.5.7

1 year ago

2.5.94

1 year ago

2.5.95

1 year ago

2.5.5

2 years ago

2.5.4

2 years ago

2.5.2

3 years ago

2.5.3

3 years ago

2.5.1

3 years ago

2.5.0

3 years ago

2.4.0

3 years ago

2.3.6

3 years ago

2.3.7

3 years ago

2.3.4

3 years ago

2.3.3

3 years ago

2.3.5

3 years ago

2.3.2

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.9

3 years ago

2.2.8

3 years ago

2.2.7

3 years ago

2.2.6

3 years ago

2.2.5

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.8

4 years ago

2.1.9

4 years ago

2.1.7

4 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.9

4 years ago

2.0.7

4 years ago

2.0.8

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.8.6

4 years ago

1.8.5

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.0.0

4 years ago