vue2.0.3 v-once doesn't work in list rendering?
See original GitHub issuelike this:
<template v-for="item in titems">
<li>
<div>{{item.message}}</div>
<div><img :src='item.url' v-once></div>
</li>
</template>
or this:
<template v-for="item in titems">
<li>
<div>{{item.message}}</div>
<div v-once><img :src='item.url'></div>
</li>
</template>
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
List Rendering - Vue.js
We can use the v-for directive to render a list of items based on an array. The v-for directive requires a special syntax...
Read more >Vue2 + Vuex - not rendering array that is set successfully in store
The issue is not the size of the array, Vuex works amazing, ... I will try to create an autocomplete that would start...
Read more >Rendering a list of Vue components - Learn web development
To learn how to loop through an array of data and render it in multiple components. Rendering lists with v-for. To be an...
Read more >Rendering large datasets in Vue.js - LogRocket Blog
In this article we will talk about several ways to reduce rendering time and increase overall performance for large datasets in Vue, as...
Read more >Common mistakes to avoid while working with Vue.js
count = 0; }, methods: { updateCount () { // JavaScript object is updated but // the component template is not rendered again...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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. emails in a conversation are stored in an array like below:
data:{emails: [{ read:false, starred:false, content:'<div> html format data</div>' },{ read:false, starred:true, content:'<div> html format data2</div>' }]}
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. In 1.x version we use {{{* email.content }}}, and it works good. After I spent some time updated VueJS to this version, I found this issue.
@koronero I don’t understand your message, I wasn’t asking for a repro, I provided one 😄