Releases: freakzlike/vue-service-model
Releases · freakzlike/vue-service-model
v0.11.0
Features
Configuration
An optional configuration with events has been added. For example you can add a callback when a detail request will be done.
import {setConfig} from 'vue-service-model'
setConfig({
events: {
onSendDetailRequest: params => {
console.log('onSendDetailRequest', params)
}
}
})
ModelManager
- You can now do a partial update (
PATCH
) by passing the optionpartial: true
on theModelManager
update
method
// Request: PATCH /albums/1/
Album.objects.update(1, {title: 'Updated Album'}, {partial: true})
Field
- You can now perform any asynchronous operation and return the result to
displayRender
/inputRender
before rendering withprepareDisplayRender
/prepareInputRender
v0.10.0
Breaking Changes
- The response of list requests (
MyModel.objects.list()
) will now not be cached by default. You can call (MyModel.objects.list({noCache: false)
) to enable caching for the specific list request
Features
Components
- A new component
FieldLabel
has been added to render the field label
<field-label :model="album" field-name="title"/>
DisplayField
andInputField
can now be rendered directly with theField
instance.
<display-field :field="album.getField('title')"/>
Models
- The
ServiceModel
base url (urls.BASE
) can now also be set directly as string
class Album extends ServiceModel {
static urls = '/albums/'
// instead of
static urls = {
BASE: '/albums/'
}
}
v0.9.0
Features
Model
- You can now create your ServiceModel instance with
myModel.create()
- You can now update your ServiceModel instance with
myModel.update()
- You can now call
myModel.save()
which will either callmyModel.create()
ormyModel.update()
- You can now delete your ServiceModel instance with
myModel.delete()
v0.8.0
Breaking Changes
vue
andvue-async-computed
are now peer dependencies and need to installed by your self.
Build
- You can now use
vue-service-model
as CDN script (See Installation)
Documentation
- Added search by algolia
- Added Codepen example
v0.7.1
Fixes
- Fix missing tslib dependency
v0.7.0
Breaking changes
parents
setting fromServiceModel
has been renamed toparentNames
(see Parents)
Features
Model
- You can now mark a field as primary key (See Field definition) which can be accessed by
myModel.pk
and will be used for service requests. - You can retrieve and set your parents of your
ServiceModel
withmyModel.parents
- You can now reload your
ServiceModel
data from service withmyModel.reload()
Field
- You can now use field input rendering
Components
InputField
component has been added to allow field input rendering
Documentation
Documentation is now provided with VuePress
v0.6.1
Fixes
- Fix prop validation on
DisplayField
when model instance gets reset
v0.6.0
Breaking Changes
- Field value is now asynchronous and should be used with
Promise
orasync
/await
Features
Field
- Field value can now be changed. Which will mutate the model data object (See Field API)
ServiceModel
- Complete cache of
ServiceModel
can now be cleared by callingMyModel.store.clear()
ModelManager
- New default methods to send create, update or delete requests
- You can now avoid caching for a specific request with
noCache
- You can now avoid request aggregation for a specific request with
noRequestAggregation
- You can now force a specific request to refresh the cache with
refreshCache
v0.5.0
All changes from js-service-model@0.5.0 are available.
Breaking Changes
- Exports have been refactored (Equal to js-service-model@0.5.0'. Imports can be made directly from
vue-service-model
Features
- Add field rendering
v0.4.0
Moved core functionality to js-service-model@0.4.0
- Vuex store has been replaced by simple class
ServiceStore
keyName
is no longer required