Skip to content

Commit 28e794f

Browse files
committed
Update dynamic components question
1 parent 949740a commit 28e794f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,9 +2131,9 @@ List of 300 VueJS Interview Questions
21312131
**[⬆ Back to Top](#table-of-contents)**
21322132
21332133
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.
21352135
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,
21372137
```javascript
21382138
new Vue({
21392139
el: '#app',
@@ -2163,6 +2163,10 @@ List of 300 VueJS Interview Questions
21632163
</div>
21642164
```
21652165
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.
2169+
21662170
**[⬆ Back to Top](#table-of-contents)**
21672171
21682172
80. ### What is the purpose of keep alive tag?

0 commit comments

Comments
 (0)