Skip to content

Logic repeating because of shared _uid of child components #11

@frankmichel

Description

@frankmichel

I noticed a problem in component logic of clusterized child components.

Assuming the child component looks like this:

example: 
{
    props: ['index'],

    template: '<div :style="(selected) ? 'background:red' : ''" v-on:click="selected=!selected">{{ index }}</div>',

    data: function()
    {
        return {
            selected: false
        }
    },
}

While the "index" property is properly set and displayed on clusterized components, it doesn't seem to be possible to keep logic within a unique child component because of the shared _uid's. So if you click on the component with the index of 1, you will see it will be repeated further down the list (in my case the component with an index of 60 has the same "selected" state... as well as 120, 180 and so on).

Applying a unique _uid to each component via track-by helps with the "selected" logic, but slows down the scrolling tremendously eliminating the advantages of vue-clusterize.

Is there any way to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions