DEV Community

Discussion on: 5 Extremely Easy ways to drastically improve your VueJS app’s speed

Collapse
 
jamesthomson profile image
James Thomson

Some great tips Vaibhav! It's amazing how some of the smallest things can have a big affect on your app.

Another, which is related to v-if, is to be careful when using it along with v-for. v-for will takes precedence over v-if and so if used on the same element, the v-if will be evaluated on every iteration. This can be useful sometimes, but if you want to conditionally load the entire element, it's best to do on an element that wraps the v-for.

Vue actually documents this, though it can be easily missed: vuejs.org/v2/guide/list.html#v-for...

Collapse
 
veebuv profile image
Vaibhav Namburi

That is also an amazing find @james ! I didn't know that - gotta love optimisation, so many little things to look at that collectively affect the overall performance.

Just passed this comment onto my team too! Good stuff!

Collapse
 
jamesthomson profile image
James Thomson

Good stuff 👍 Did you see Guillaume Chau's performance presentation a couple months back? If not, you're in for a treat 😀 Some really juicy stuff in there!

vuemastery.com/conferences/vueconf...

Thread Thread
 
veebuv profile image
Vaibhav Namburi

Just saw the whole thing! OMG - he's a bloody legend!