Skip to content

Inserting Data With Default Values #57

@Zenthae

Description

@Zenthae

https://next.vuex-orm.org/guide/repository/inserting-data.html#inserting-data-with-default-values

The new method will create a record with all fields filled with default values defined in the model.

const user = store.$repo(User).new()

// { id: '$uid1', name: '' }

that's what's written on the doc, but the new() method doesn't exist in practice ? so how i'm supposed to add data ?

this.$store.$repo(User).insert(new User()); ? that's what i'm using at the moment, but i'm not sure if it's the right way to do it

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions