-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
map only one row - mapRowFields #88
base: master
Are you sure you want to change the base?
Conversation
I think this PR solves #43 |
Hello @maoberlehner, could you take a look at this? Thank you |
I did move forward with this PR in my project and solve the 'dynamic parameter' like this: data() {
return {
itemId: this.$route.params.room ? decodeURIComponent(this.$route.params.room) : uuid(),
};
}, ...mapRowFields('rooms', { item: (c) => { return `byId[${c.itemId}]`; } }), |
Hey @guilemos thanks for contributing! There are a couple of things that need to be fixed before I can consider to merge this PR:
Thanks! |
This reverts commit 8143441.
Hi @maoberlehner, Once mapRowFields feature is much more similar to mapFields than mapMultiRowFields, I wondering if make more sense add two features to mapFields function:
So I did submit PR #95 which implements the solution above. I'll keep PR #88 so you can decide which one is a best solution. In short, PR #88 creates a new function semantically similar to mapFields once target is "map fields" of only one "row" inside a array, just like current mapFields function does inside "store". #95 add 2 new abilities to the mapFields function so we can avoid 2 functions with same semantic. Thank you! |
I’ll update the docs after you decide. Regards |
Support to map only one row that lives at a array/object when we are out of a loop.
This is useful when working with "active row".
However, I am stuck with the best way to use it. For this PR be worth, we should be able to make row parameter dynamic.
Reading the docs, I think same happens here:
'addresses[0].town',
I think this is a limitation related with vuex#863
Maybe I can make this PR better using a 'active property' approach, like:
Any ideas?
Best regards