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.
8
10
9
11
## Install
12
+
10
13
```bash
11
14
npm install --save vuex-map-fields
12
15
```
13
16
14
17
### Basic example
18
+
15
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)).
16
20
17
21
#### Store
22
+
18
23
```js
19
24
importVuefrom'vue';
20
25
importVuexfrom'vuex';
@@ -44,6 +49,7 @@ export default new Vuex.Store({
44
49
```
45
50
46
51
#### Component
52
+
47
53
```html
48
54
<template>
49
55
<divid="app">
@@ -71,9 +77,11 @@ export default {
71
77
```
72
78
73
79
### Nested properties
80
+
74
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.
75
82
76
83
#### Store
84
+
77
85
```js
78
86
importVuefrom'vue';
79
87
importVuexfrom'vuex';
@@ -104,6 +112,7 @@ export default new Vuex.Store({
104
112
```
105
113
106
114
#### Component
115
+
107
116
```html
108
117
<template>
109
118
<divid="app">
@@ -134,6 +143,7 @@ export default {
134
143
```
135
144
136
145
### Rename properties
146
+
137
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.
138
148
139
149
```html
@@ -159,9 +169,11 @@ export default {
159
169
```
160
170
161
171
### Custom getters and mutations
172
+
162
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.
163
174
164
175
#### Store
176
+
165
177
```js
166
178
importVuefrom'vue';
167
179
importVuexfrom'vuex';
@@ -196,6 +208,7 @@ export default new Vuex.Store({
196
208
```
197
209
198
210
#### Component
211
+
199
212
```html
200
213
<template>
201
214
<divid="app">
@@ -230,9 +243,11 @@ export default {
230
243
```
231
244
232
245
### Vuex modules
246
+
233
247
Vuex makes it possible to divide the store into modules.
234
248
235
249
#### Store
250
+
236
251
```js
237
252
importVuefrom'vue';
238
253
importVuexfrom'vuex';
@@ -270,6 +285,7 @@ export default new Vuex.Store({
270
285
```
271
286
272
287
#### Component
288
+
273
289
```html
274
290
<template>
275
291
<divid="app">
@@ -296,9 +312,11 @@ export default {
296
312
```
297
313
298
314
### Namespaced Vuex modules
315
+
299
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.
300
317
301
318
#### Store
319
+
302
320
```js
303
321
importVuefrom'vue';
304
322
importVuexfrom'vuex';
@@ -327,6 +345,7 @@ export default new Vuex.Store({
327
345
```
328
346
329
347
#### Component
348
+
330
349
```html
331
350
<template>
332
351
<divid="app">
@@ -352,9 +371,11 @@ export default {
352
371
```
353
372
354
373
### Multi-row fields
374
+
355
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.
356
376
357
377
#### Store
378
+
358
379
```js
359
380
importVuefrom'vue';
360
381
importVuexfrom'vuex';
@@ -387,6 +408,7 @@ export default new Vuex.Store({
387
408
```
388
409
389
410
#### Component
411
+
390
412
```html
391
413
<template>
392
414
<divid="app">
@@ -409,6 +431,7 @@ export default {
409
431
```
410
432
411
433
## Upgrade from 0.x.x to 1.x.x
434
+
412
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.
413
436
414
437
```js
@@ -437,11 +460,15 @@ export default new Vuex.Store({
0 commit comments