Skip to content

Releases: freakzlike/vue-service-model

v0.11.0

03 May 09:22
ee798a7
Compare
Choose a tag to compare

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

// Request: PATCH /albums/1/
Album.objects.update(1, {title: 'Updated Album'}, {partial: true})

Field

v0.10.0

24 Apr 11:32
3a33ce0
Compare
Choose a tag to compare

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 and InputField can now be rendered directly with the Field 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

08 Apr 19:02
Compare
Choose a tag to compare

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 call myModel.create() or myModel.update()
  • You can now delete your ServiceModel instance with myModel.delete()

v0.8.0

02 Apr 15:07
Compare
Choose a tag to compare

Breaking Changes

  • vue and vue-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

31 Mar 18:40
Compare
Choose a tag to compare

Fixes

  • Fix missing tslib dependency

v0.7.0

30 Mar 15:18
Compare
Choose a tag to compare

Breaking changes

  • parents setting from ServiceModel has been renamed to parentNames (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 with myModel.parents
  • You can now reload your ServiceModel data from service with myModel.reload()

Field

Components

Documentation

Documentation is now provided with VuePress

v0.6.1

24 Mar 19:59
Compare
Choose a tag to compare

Fixes

  • Fix prop validation on DisplayField when model instance gets reset

v0.6.0

23 Mar 20:04
Compare
Choose a tag to compare

Breaking Changes

  • Field value is now asynchronous and should be used with Promise or async/await

Features

Field

  • Field value can now be changed. Which will mutate the model data object (See Field API)

ServiceModel

ModelManager

v0.5.0

12 Mar 19:51
Compare
Choose a tag to compare

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

v0.4.0

06 Mar 16:04
Compare
Choose a tag to compare

Moved core functionality to js-service-model@0.4.0

  • Vuex store has been replaced by simple class ServiceStore
  • keyName is no longer required