v-b-modal problem with v-if
See original GitHub issueWhile I am not entirely sure if this is a Bootstrap Vue issue or a pure Vue issue please see the following:
Problem:
When a <b-btn> with a v-b-modal directive is replaced with another <b-btn> without that directive using v-if/v-else in VDOM the effects of the directive are bound also to the second component.
Template code:
<div id="app">
<b-btn @click="doModal = !doModal">Toggle modal</b-btn>
<b-btn v-b-modal.modal v-if="doModal">Modal</b-btn>
<b-btn v-else>No modal</b-btn>
<b-modal id="modal">Modal text</b-modal>
</div>
JS code:
new Vue({
el: '#app',
data: {
doModal: true,
}
})
Working example: https://jsfiddle.net/fv1mjnfa/7/
Current result
Button named “Modal” triggers modal visibility. After clicking button named “Toggle modal” the above button is replaced by button named “No modal”. Clicking button “No modal” also triggers the modal.
Expected result
Button with “No modal” text should not trigger the modal.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
12.4 - Detecting Multicollinearity Using Variance Inflation Factors
A VIF of 1 means that there is no correlation between the k t h predictor and the remaining predictor variables, and hence...
Read more >How can I solve the issue that VIF doesn't work after added ...
I created ordered logit models using polr in RStudio and the using the vif. It worked fine and I got my results. But...
Read more >Variance Inflation Factor (VIF) - Investopedia
Variance inflation factor (VIF) is a measure of the amount of multicollinearity in a set of multiple regression variables.
Read more >Dealing with Multicollinearity Problem in Analysis of Side ...
If VIF is more than 5 for one or more of the independent variables, then steps must be taken to remove the multicollinearity...
Read more >Frequency division denoising algorithm based on VIF ...
First, the ultrasound image was decomposed into a series of sub-modal images using 2D variational mode decomposition (2D-VMD), and adaptively ...
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
I’ve slightly updated your examle to make it work https://jsfiddle.net/cihkem/5y2fs62q/ The catch is to add keys to elements, so Vue will treat them as different vnodes.
Ok, I’ll review your proposals a bit later.