-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
vue2.0.3 v-once doesn't work in list rendering? #3964
Comments
Please make sure to read the Issue Reporting Guidelines before opening new issues. As for this issue, I am looking into this. |
Here's the repro: https://jsfiddle.net/posva/6up9mdqf/ |
@posva Here's the repro:https://jsfiddle.net/6up9mdqf/4/ |
@koronero I don't understand your message, I wasn't asking for a repro, I provided one 😄 |
I just met a similar (probably the same) issue with v-once and found here. Thanks. |
@koronero @seekerlee I think As a side note: don't use |
@posva here's my case just for reference: We are working on en email app and emails are rendered by VueJS since 1.x version. Since the email html content could be huge, we don't want it be updated since born. And we need to do lots of DOM operation to the html content (I'm using a custom directive to do it when 'inserted'). For example: add ellipsis and hide quoted content, highlight some text, add some link, process mentions by @ symbol etc. We also don't want these operations to be executed more than once. So we have the requirement for both v-once and v-for. |
But using v-once on the v-for should work for your case, doesn't it? |
@posva using v-once on the v-for doesn't not run into error. But it's not what we want. For example: we have a group of email and we show them use v-for and v-once. User can mark any email as starred, then the UI should reflect and show a ⭐️. If we use v-once on the v-for, the UI will not change after user star the email. |
@seekerlee Does using the v-once inside a component fixes the problem? |
I will try and let you know. |
Here's an example: https://jsfiddle.net/posva/5k4ptmqg/ |
Thanks very much for your fiddle. It works for my case. |
This bug reappeared in version 2.5.2 version: |
like this:
or this:
The text was updated successfully, but these errors were encountered: