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
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -370,6 +370,27 @@ export default {
370
370
</script>
371
371
```
372
372
373
+
Or you can pass the module namespace string as the first argument of the `mapFields()` function.
374
+
375
+
```html
376
+
<template>
377
+
<divid="app">
378
+
<inputv-model="foo">
379
+
</div>
380
+
</template>
381
+
382
+
<script>
383
+
import { mapFields } from'vuex-map-fields';
384
+
385
+
exportdefault {
386
+
computed: {
387
+
// `fooModule` is the name of the Vuex module.
388
+
...mapFields(`fooModule`, ['foo']),
389
+
},
390
+
};
391
+
</script>
392
+
```
393
+
373
394
### Multi-row fields
374
395
375
396
If you want to build a form which allows the user to enter multiple rows of a specific data type with multiple fields (e.g. multiple addresses) you can use the multi-row field mapping function.
0 commit comments