question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Repeated inline-template within v-if is wrongfully reused

See original GitHub issue

Vue.js version

2.0.6 (latest)

Reproduction Link

http://codepen.io/guidobouman/pen/qqajGr

Steps to reproduce

Repeat a conditional (v-if, not v-show) check with an inline-template component inside.

What is Expected?

When changing the value, the conditional check should display the right child component. Which in turn displays it’s own inline-template with the unique value.

What is actually happening?

The first time a value (for the v-if) is selected, the right inline-template is being used. When you change the value afterwards the inline-template from the first value is being re-used each time.

Additional info

When none of the conditional checks hit (by selecting the value 0), the state is reset. The next matching value that’s selected will display the correct value again.

So: As long as one of the conditional checks matches, the template is not being reset.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
yyx990803commented, Nov 16, 2016

@guidobouman yep, we are working on it, thanks for the suggestion!

2reactions
LinusBorgcommented, Nov 16, 2016

key the dynamic components accordingly:

<div is="child" inline-template :key="value">

Unfortunately, the docs are not very clear on this currently, but this is expected behaviour.

As stated somewhere else, about switching between elements:

When toggling between elements that have the same tag name, you must tell Vue that they are distinct elements by giving them unique key attributes. Otherwise, Vue’s compiler will only replace the content of the element for efficiency.

https://vuejs.org/v2/guide/transitions.html#Transitioning-Between-Elements

It works similary for dynamic components.

@chrisvfritz Can you think of a better place in the docs to mention / expand on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

10.7 - Detecting Multicollinearity Using Variance Inflation Factors
As the name suggests, a variance inflation factor (VIF) quantifies how much the ... factor exists for each of the predictors in a...
Read more >
Variance Inflation Factor (VIF) - Investopedia
A variance inflation factor (VIF) provides a measure of multicollinearity among the independent variables in a multiple regression model.
Read more >
low VIF but having correlation in multiple regression?
Multicollinearity problem is related to an excessive correlation of two predictors. In this cases, it does not seem excessive according to ...
Read more >
Multicollinearity and misleading statistical results - PMC - NCBI
Diagnostic tools of multicollinearity include the variance inflation factor (VIF), condition index and condition number, and variance decomposition proportion ( ...
Read more >
When Can You Safely Ignore Multicollinearity?
1) To detect multicollinearity in multiple regression we will use VIF. What to do if I am working with Logistic Regression.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found