Skip to content
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

Keep-state Global Annotation #10953

Closed
Galfour opened this issue Dec 25, 2019 · 2 comments
Closed

Keep-state Global Annotation #10953

Galfour opened this issue Dec 25, 2019 · 2 comments

Comments

@Galfour
Copy link

Galfour commented Dec 25, 2019

What problem does this feature solve?

To maintain state in an element of a list, one can use v-bind:key, as explained here. This makes creating a todo-list while keeping the local state intact (selections, focus, input text, other things the browser / included plugins deal with for us) trivial.

However, if I happen to want more than a todo-list, like, a Kanban Board, and I want to be able to move elements across columns, well, it does not work any more.
There are some hacks that could work for this particular case (having the Kanban board be a single array, that simply looks like a Kanban board through bad CSS tricks). But they are bad, and can not be extended to more complex situations (like, a recursive todo-list, the kind that you can find on Workflowy, Dynalist, Notion, etc.).

What does the proposed API look like?

How I could see it work is with a global-key attribute on vue elements. It would act exactly like key in v-for, but globally.

@posva
Copy link
Member

posva commented Dec 25, 2019

I'm not sure to grasp how global-key would work since it's precisely supposed to be local to an element/component. Overall, the information here is not enough to understand the feature request and it makes me understand you need guidance in implementing a board more than anything else. For the purpose, please use the forum, the Discord server or StackOverflow.

@posva posva closed this as completed Dec 25, 2019
@Galfour
Copy link
Author

Galfour commented Dec 25, 2019

@posva

I'm not sure to grasp how global-key would work
you need guidance in implementing a board more than anything else

I tried to follow the form to make a ticket, and gave a fake example to illustrate my point. I don't need to write a Kanban board.

Perhaps I should have been more technical from the get-go? I'd like to give VueJS hints to its reconciliation algorithm to avoid re-renders. Alternatively, I'd like to be able to re-parent components. A similar issue on React is facebook/react#3965 .
Those two comments might be clearer explanations of the need:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants