Replies: 2 comments 2 replies
|
In my opinion using v-scope inside v-scope goes against its design. Why would a child have a different scope from the parent. Your code should look more like : Should work as expected and pass the tests |
|
In this case you are using another component for the love of it and not because is really necessary. It is normal what is happening and no a bug. You have hardcoded the data for that component and it will be remounted as the v-if will destroy the HTML node not just hide it. If you really want to retain the input value you should be using and Store / State outside the component so that every time its destroyed and re-created it uses the latest Store value and not the default. Adding to many unnecessary v-scopes in your solution will make it underperform |
Uh oh!
There was an error while loading. Please reload this page.
I just found out that v-scope is re-executed every time the template re-render. This makes states inside a v-if that get toggled off and on again get a reset.
The behavior is reproduced in the following markup.
with these Cypress-like step, the assertion is wrong.
Is this going to change in the future or it will keeps being functional the same input the same output?
All reactions