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: CODE_OF_CONDUCT.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
# Contributor Covenant Code of Conduct
2
2
3
3
## Our Pledge
4
+
4
5
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
5
6
6
7
## Our Standards
8
+
7
9
Examples of behavior that contributes to creating a positive environment include:
8
10
9
11
- Using welcoming and inclusive language
@@ -21,19 +23,23 @@ Examples of unacceptable behavior by participants include:
21
23
- Other conduct which could reasonably be considered inappropriate in a professional setting
22
24
23
25
## Our Responsibilities
26
+
24
27
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
25
28
26
29
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
27
30
28
31
## Scope
32
+
29
33
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
30
34
31
35
## Enforcement
36
+
32
37
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at markus.oberlehner@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
33
38
34
39
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
35
40
36
41
## Attribution
42
+
37
43
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
Enable two-way data binding for form fields saved in a Vuex store.
9
10
10
11
## Install
12
+
11
13
```bash
12
14
npm install --save vuex-map-fields
13
15
```
14
16
15
17
### Basic example
18
+
16
19
The following example component shows the most basic usage, for mapping fields to the Vuex store using two-way data binding with `v-model`, without directly modifying the store itself, but using getter and setter functions internally (as it is described in the official Vuex documentation: [Two-way Computed Property](https://vuex.vuejs.org/en/forms.html#two-way-computed-property)).
17
20
18
21
#### Store
22
+
19
23
```js
20
24
importVuefrom'vue';
21
25
importVuexfrom'vuex';
@@ -45,6 +49,7 @@ export default new Vuex.Store({
45
49
```
46
50
47
51
#### Component
52
+
48
53
```html
49
54
<template>
50
55
<divid="app">
@@ -72,9 +77,11 @@ export default {
72
77
```
73
78
74
79
### Nested properties
80
+
75
81
Oftentimes you want to have nested properties in the Vuex store. `vuex-map-fields` supports nested data structures by utilizing the object dot string notation.
76
82
77
83
#### Store
84
+
78
85
```js
79
86
importVuefrom'vue';
80
87
importVuexfrom'vuex';
@@ -105,6 +112,7 @@ export default new Vuex.Store({
105
112
```
106
113
107
114
#### Component
115
+
108
116
```html
109
117
<template>
110
118
<divid="app">
@@ -135,6 +143,7 @@ export default {
135
143
```
136
144
137
145
### Rename properties
146
+
138
147
Sometimes you might want to give your computed properties different names than what you're using in the Vuex store. Renaming properties is made possible by passing an object of fields to the `mapFields` function instead of an array.
139
148
140
149
```html
@@ -160,9 +169,11 @@ export default {
160
169
```
161
170
162
171
### Custom getters and mutations
172
+
163
173
By default `vuex-map-fields` is searching for the given properties starting from the root of your state object. Depending on the size of your application, the state object might become quite big and therefore updating the state starting from the root might become a performance issue. To circumvent such problems, it is possible to create a custom `mapFields()` function which is configured to access custom mutation and getter functions which don't start from the root of the state object but are accessing a specific point of the state.
164
174
165
175
#### Store
176
+
166
177
```js
167
178
importVuefrom'vue';
168
179
importVuexfrom'vuex';
@@ -197,6 +208,7 @@ export default new Vuex.Store({
197
208
```
198
209
199
210
#### Component
211
+
200
212
```html
201
213
<template>
202
214
<divid="app">
@@ -231,9 +243,11 @@ export default {
231
243
```
232
244
233
245
### Vuex modules
246
+
234
247
Vuex makes it possible to divide the store into modules.
235
248
236
249
#### Store
250
+
237
251
```js
238
252
importVuefrom'vue';
239
253
importVuexfrom'vuex';
@@ -271,6 +285,7 @@ export default new Vuex.Store({
271
285
```
272
286
273
287
#### Component
288
+
274
289
```html
275
290
<template>
276
291
<divid="app">
@@ -297,9 +312,11 @@ export default {
297
312
```
298
313
299
314
### Namespaced Vuex modules
315
+
300
316
By default, mutations and getters inside modules are registered under the global namespace – but you can mark modules as `namespaced` which prevents naming clashes of mutations and getters between modules.
301
317
302
318
#### Store
319
+
303
320
```js
304
321
importVuefrom'vue';
305
322
importVuexfrom'vuex';
@@ -328,6 +345,7 @@ export default new Vuex.Store({
328
345
```
329
346
330
347
#### Component
348
+
331
349
```html
332
350
<template>
333
351
<divid="app">
@@ -353,9 +371,11 @@ export default {
353
371
```
354
372
355
373
### Multi-row fields
374
+
356
375
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.
357
376
358
377
#### Store
378
+
359
379
```js
360
380
importVuefrom'vue';
361
381
importVuexfrom'vuex';
@@ -388,6 +408,7 @@ export default new Vuex.Store({
388
408
```
389
409
390
410
#### Component
411
+
391
412
```html
392
413
<template>
393
414
<divid="app">
@@ -410,6 +431,7 @@ export default {
410
431
```
411
432
412
433
## Upgrade from 0.x.x to 1.x.x
434
+
413
435
Instead of accessing the state directly, since the 1.0.0 release, in order to enable the ability to implement custom getters and mutations, `vuex-map-fields` is using a getter function to access the state. This makes it necessary to add a getter function to your Vuex store.
414
436
415
437
```js
@@ -438,12 +460,15 @@ export default new Vuex.Store({
0 commit comments