v0.35.0
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! 🎉