Vuex mutations, used via this.$store.commit()
Methods
# static addRecords(state, records)
Add record(s) to the store, according to mergeRecords
config option
Parameters:
Name | Type | Description |
---|---|---|
state |
object | The Vuex state object |
records |
object | The record(s) to be added |
# static clearRecords(state, records)
Delete all records from the store for a given type
Parameters:
Name | Type | Description |
---|---|---|
state |
object | The Vuex state object |
records |
object | A record with type set. |
# static deleteRecord(state, record)
Delete a record from the store.
Parameters:
Name | Type | Description |
---|---|---|
state |
object | The Vuex state object |
record |
string | object | The record to be deleted |
# static mergeRecords(state, records)
Merge (or add) records to the store
Parameters:
Name | Type | Description |
---|---|---|
state |
object | The Vuex state object |
records |
object | The record(s) to be merged |
# static replaceRecords(state, records)
Replace (or add) record(s) to the store
Parameters:
Name | Type | Description |
---|---|---|
state |
object | The Vuex state object |
records |
object | The record(s) to be replaced |