You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2131,9 +2131,9 @@ List of 300 VueJS Interview Questions
2131
2131
**[⬆ Back to Top](#table-of-contents)**
2132
2132
2133
2133
79. ### What are dynamic components?
2134
-
The dynamic component is used to dynamically switch beetween multiple components using **<component>** element and pass data to v-bind:is attribute.
2134
+
The dynamic component will allow you to dynamically switch beetween multiple components without updating the route of the application and even retaining the state of the component when switching back to the initial component. It works by using `<component>` tag with `v-bind:is` attribute which accept dynamic component.
2135
2135
2136
-
Let's create a dynamic component to switch between different pages of a website,
2136
+
Let's create a dynamic component vue instance to switch between different pages of a website,
2137
2137
```javascript
2138
2138
newVue({
2139
2139
el:'#app',
@@ -2163,6 +2163,10 @@ List of 300 VueJS Interview Questions
2163
2163
</div>
2164
2164
```
2165
2165
2166
+
The component will be unmounted when it is switched away but it is possible to force the inactive component alive using `<keep-alive>` component
2167
+
2168
+
**Note:** The value of `:is` attribute can be either name of the registered component or the actual imported object itself.
0 commit comments