Skip to content

Commit 780f96e

Browse files
committed
Merge branch 'release/1.1.6'
2 parents 659082b + 48f9806 commit 780f96e

File tree

5 files changed

+39
-4
lines changed

5 files changed

+39
-4
lines changed

CODE_OF_CONDUCT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Contributor Covenant Code of Conduct
22

33
## Our Pledge
4+
45
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.
56

67
## Our Standards
8+
79
Examples of behavior that contributes to creating a positive environment include:
810

911
- Using welcoming and inclusive language
@@ -21,19 +23,23 @@ Examples of unacceptable behavior by participants include:
2123
- Other conduct which could reasonably be considered inappropriate in a professional setting
2224

2325
## Our Responsibilities
26+
2427
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.
2528

2629
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.
2730

2831
## Scope
32+
2933
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.
3034

3135
## Enforcement
36+
3237
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.
3338

3439
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.
3540

3641
## Attribution
42+
3743
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
3844

3945
[homepage]: http://contributor-covenant.org

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Contributing
22

33
## Reporting Issues
4+
45
Found a problem? Want a new feature?
56

67
- See if your issue or idea has [already been reported].
@@ -9,6 +10,7 @@ Found a problem? Want a new feature?
910
Remember, a bug is a *demonstrable problem* caused by *our* code.
1011

1112
## Submitting Pull Requests
13+
1214
Pull requests are the greatest contributions, so be sure they are focused in scope, and do avoid unrelated commits.
1315

1416
1. To begin, [fork this project], clone your fork, and add our upstream.

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# vuex-map-fields
2-
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=N8DK47KJLEAN8)
2+
3+
[![Patreon](https://img.shields.io/badge/patreon-donate-blue.svg)](https://www.patreon.com/maoberlehner)
4+
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/maoberlehner)
35
[![Build Status](https://travis-ci.org/maoberlehner/vuex-map-fields.svg?branch=master)](https://travis-ci.org/maoberlehner/vuex-map-fields)
46
[![Coverage Status](https://coveralls.io/repos/github/maoberlehner/vuex-map-fields/badge.svg?branch=master)](https://coveralls.io/github/maoberlehner/vuex-map-fields?branch=master)
57
[![GitHub stars](https://img.shields.io/github/stars/maoberlehner/vuex-map-fields.svg?style=social&label=Star)](https://github.com/maoberlehner/vuex-map-fields)
68

79
Enable two-way data binding for form fields saved in a Vuex store.
810

911
## Install
12+
1013
```bash
1114
npm install --save vuex-map-fields
1215
```
1316

1417
### Basic example
18+
1519
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)).
1620

1721
#### Store
22+
1823
```js
1924
import Vue from 'vue';
2025
import Vuex from 'vuex';
@@ -44,6 +49,7 @@ export default new Vuex.Store({
4449
```
4550

4651
#### Component
52+
4753
```html
4854
<template>
4955
<div id="app">
@@ -71,9 +77,11 @@ export default {
7177
```
7278

7379
### Nested properties
80+
7481
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.
7582

7683
#### Store
84+
7785
```js
7886
import Vue from 'vue';
7987
import Vuex from 'vuex';
@@ -104,6 +112,7 @@ export default new Vuex.Store({
104112
```
105113

106114
#### Component
115+
107116
```html
108117
<template>
109118
<div id="app">
@@ -134,6 +143,7 @@ export default {
134143
```
135144

136145
### Rename properties
146+
137147
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.
138148

139149
```html
@@ -159,9 +169,11 @@ export default {
159169
```
160170

161171
### Custom getters and mutations
172+
162173
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.
163174

164175
#### Store
176+
165177
```js
166178
import Vue from 'vue';
167179
import Vuex from 'vuex';
@@ -196,6 +208,7 @@ export default new Vuex.Store({
196208
```
197209

198210
#### Component
211+
199212
```html
200213
<template>
201214
<div id="app">
@@ -230,9 +243,11 @@ export default {
230243
```
231244

232245
### Vuex modules
246+
233247
Vuex makes it possible to divide the store into modules.
234248

235249
#### Store
250+
236251
```js
237252
import Vue from 'vue';
238253
import Vuex from 'vuex';
@@ -270,6 +285,7 @@ export default new Vuex.Store({
270285
```
271286

272287
#### Component
288+
273289
```html
274290
<template>
275291
<div id="app">
@@ -296,9 +312,11 @@ export default {
296312
```
297313

298314
### Namespaced Vuex modules
315+
299316
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.
300317

301318
#### Store
319+
302320
```js
303321
import Vue from 'vue';
304322
import Vuex from 'vuex';
@@ -327,6 +345,7 @@ export default new Vuex.Store({
327345
```
328346

329347
#### Component
348+
330349
```html
331350
<template>
332351
<div id="app">
@@ -352,9 +371,11 @@ export default {
352371
```
353372

354373
### Multi-row fields
374+
355375
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.
356376

357377
#### Store
378+
358379
```js
359380
import Vue from 'vue';
360381
import Vuex from 'vuex';
@@ -387,6 +408,7 @@ export default new Vuex.Store({
387408
```
388409

389410
#### Component
411+
390412
```html
391413
<template>
392414
<div id="app">
@@ -409,6 +431,7 @@ export default {
409431
```
410432

411433
## Upgrade from 0.x.x to 1.x.x
434+
412435
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.
413436

414437
```js
@@ -437,11 +460,15 @@ export default new Vuex.Store({
437460
```
438461

439462
## About
463+
440464
### Author
465+
441466
Markus Oberlehner
442467
Website: https://markus.oberlehner.net
443468
Twitter: https://twitter.com/MaOberlehner
444-
PayPal.me: https://paypal.me/maoberlehner
469+
PayPal.me: https://paypal.me/maoberlehner
470+
Patreon: https://www.patreon.com/maoberlehner
445471

446472
### License
473+
447474
MIT

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuex-map-fields",
3-
"version": "1.1.5",
3+
"version": "1.1.6",
44
"description": "Enable two-way data binding for form fields saved in a Vuex store",
55
"keywords": [
66
"vue",

0 commit comments

Comments
 (0)