You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.log(savedItem) // The item returned from the API call
60
+
}
61
+
}
62
+
}
63
+
</script>
45
64
```
46
65
66
+
Here's another example of how you could use the form wrapper to both save the form and close a modal at the same time. (The modal is not shown in the template markup.) Notice how the `@save` handler is an inline function that sets `isModalVisible` to false, then on a new line it calls save. This is handled perfectly by Vue.
console.log(savedItem) // The item returned from the API call
102
+
}
103
+
}
104
+
}
105
+
</script>
106
+
```
47
107
### Props
48
108
49
109
-`item`: {Object} a model instance from the Vuex store.
@@ -55,6 +115,6 @@ The `FeathersVuexFormWrapper` component uses the "clone and commit" pattern to c
55
115
The default slot contains only four attributes. The `clone` data can be passed to the child component. The `save`, `reset`, and `remove` are meant to be bound to events emitted from the child component.
56
116
57
117
-`clone`: {Object} The cloned record. Each record in the store can have a single clone. The clones are stored on the service's model class, by default.
58
-
-`save`: {Function} When called, it commits the data and saves the record (with eager updating, by default. See the `eager` prop.).
118
+
-`save`: {Function} When called, it commits the data and saves the record (with eager updating, by default. See the `eager` prop.) The save method calls `instance.save()`, internally, so you can pass a params object, if needed.
59
119
-`reset`: {Function} When called, the clone data will be reset back to the data that is currently found in the store for the same record.
60
120
-`remove`: {Function} When called, it removes the record from the API server and the Vuex store.
0 commit comments