v1.0.0
Breaking
- errorsKeyName =>
errorProperty
, Set this innuxt.config
export default {
modules: [
// simple usage
'vue-api-queries/nuxt',
// With options
['vue-api-queries/nuxt', { errorProperty: 'errors' }],
'@nuxtjs/axios',
],
apiQueries: { errorProperty: 'errors' },
}
- in custom method in proxy, remove
this.endpoint
to set it as default. See the Examples:
Before:
import BaseProxy from './BaseProxy'
class PostProxy extends BaseProxy {
constructor(parameters = {}) {
super('posts', parameters)
}
tags(id: string | number) {
return this.submit('get', `/this.endpoint/${id}/tags`)
}
}
export default PostProxy
Now:
import BaseProxy from './BaseProxy'
class PostProxy extends BaseProxy {
constructor(parameters = {}) {
super('posts', parameters)
}
tags<T>(id: string | number) {
return this.submit<T>('get', `${id}/tags`)
}
}
export default PostProxy
OR
import BaseProxy from './BaseProxy'
class PostProxy extends BaseProxy {
constructor(parameters = {}) {
super('posts', parameters)
}
tags<T>(id: string | number) {
return this.submit<T>('get', `/${id}/tags`) // the diff is /
}
}
export default PostProxy
Added
count
method to validator
We can access this like:this.$errors.count()
or in template$errors.count()
return errors count
All above was merged from PR (#72 )