GithubHelp home page GithubHelp logo

Comments (5)

maoberlehner avatar maoberlehner commented on May 22, 2024

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.

RVeligotskiy avatar RVeligotskiy commented on May 22, 2024

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.

geoidesic avatar geoidesic commented on May 22, 2024

@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.

geoidesic avatar geoidesic commented on May 22, 2024

@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.

conor-odro avatar conor-odro commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.