Skip to content

v0.35.0

Compare
Choose a tag to compare
@kiaking kiaking released this 27 Jan 14:42
· 157 commits to master since this release

New Features

Context based model access.

You can get model objects through store instance. Please refer to issue #514 for the reason why we needed this.

Now you can access models like this.

// String base access.
const User = store.$db.model('users')

// Type base access.
import User from '@/models/User'

const UserModel = store.$db.model(User)

To be able to add this feature, there're few internal breaking changes. It shouldn't affect most of the users.

  • The Query now must receive database instance as the first argument.
  • The Query's get methods such as getModel are now an instance method.
  • The Container now holds store instance instead of a database.

Please refer to the documentation for more details.

Register models at runtime.

Issue #187

Now you can register a new model after you've installed Vuex ORM to Vuex. All you need to do is to call database.register.

Thanks to @SzNagyMisu for this wonderful PR! 🎉

Fixes

  • #513 Make Model.fields().attribute.value correctly typed.
  • #526 Exclude $id from toJson() method.
  • #536 Now the pivot table composite key can be in any order.