Comments (5)
Thanks for providing an jsfiddle!
I don't know for sure why {{ characteristic }}
renders an empty {}
but rendering the properties works as expected: https://jsfiddle.net/te4ordgh/21/
from vuex-map-fields.
Thank you!
I had warn Cannot read property 'name' of undefined when i define data like that:
var all = []
all[1] = {id:1, name:'name1'}
all[2] = {id:3, name:'name1'}
...
state:{all},
...
But this is Vue feature
from vuex-map-fields.
@RVeligotskiy can you please show the data definition that did work? So that we can see the difference. It would also help if you could explain what you mean by "this is a vue feature"?
from vuex-map-fields.
@maoberlehner If you create a separate independent computed value that points to characteristic
then that reference to the store will not render empty.
See here for example of this based on above example: https://jsfiddle.net/noeldacosta/o1ae65nd/7/
This suggests that this is a reactivity issue. This is highlighted by the Log Object
and Log Aliased Object
buttons I've added. If you view the inspector you will see that the aliased computed property is an observer whereas the other is not. The same applies to each of the object's properties.
This poses a problem because it means that it is not possible to (for example) filter this array of objects for doing such things as grouping or sorting records by a field.
from vuex-map-fields.
Is there any further updates on this? This is still an issue in June 2021.
A workaround for now is to use the store directly, but it doesn't feel like the correct solution.
this.$store.state.characteristics
from vuex-map-fields.
Related Issues (20)
- How I can handle custom getter / setter for a single property. HOT 1
- createHelper concatenation goes haywire HOT 2
- nested arrays?
- Duplicate field names
- Can we use also actions and not only mutations?
- Support Vuex 4 HOT 3
- [PERFORMANCE] mapMultiRowFields is extremely slow with 100 items HOT 1
- cannot commit from programmatically + new feature action CRUD (nice)
- nuxt-vite support? HOT 2
- Use Vue.set in updateField to support reactive array watching HOT 1
- Namespaced Vuex modules with Folder structure possible?
- ...mapFields conditionally based on a prop value (question)
- mapMultiRowFields doesn't appear to support dot notation? HOT 1
- Pass namespace as a variable to mapFields
- How to handle array(with primitives) fields? - ["one", "two "]
- Reference a specific array index in mapFields?
- How to use ...mapFields in script setup and typescript?
- Something wrong when I use electron-vue HOT 1
- ...mapFields with CYpress componenet testing
- change "Twitter" to "𝕏 (Twitter)"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuex-map-fields.