dynamic component is vs :is
See original GitHub issueI was trying to implement dynamic component as explained here: http://vuejs.org/guide/components.html#Dynamic-Components
Not sure if it’s a problem with the documentation or a bug but the example in the documentation does not work, had to remove the colon in front of :is
to get it working
Vue.js version
1.0.26 (developement)
What is Expected?
Using <component :is="...">
didnt work as the documentation explains
What is actually happening?
<component is="...">
(is instead of :is) worked
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (10 by maintainers)
Top Results From Across the Web
An Overview of Vue Dynamic Components - LearnVue
Dynamic components are, well, ways to dynamically switch between components at run-time. While this is a circular definition, ...
Read more >Dynamic & Async Components - Vue.js
Recreating dynamic components is normally useful behavior, but in this case, ... using the name option on a component, or through local/global registration....
Read more >2 Simple Examples to understand how Dynamic components ...
ComponentFactory is the base class for a factory that can create a component dynamically. ComponentFactoryResolver maps the Components to the ComponentFactory ...
Read more >vue.js: what's the difference between <component :is="comp ...
When using dynamic component in vue, we could use component or html tag such as div as the tag name: <component :is="comp-name"></component>.
Read more >Dynamic Components with Vue's 'component' - Telerik
Another common scenario is having an API endpoint telling you what sort of components it wants the frontend to render on the screen—a...
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
@mikekidder I don’t think that it makes sense to explain this for the
is
attribute specifically - it works just like any other prop in Vue.We have documented how to use props as well as common pitfalls throughout the documentation, e.g. here: http://vuejs.org/guide/components.html#Literal-vs-Dynamic
To be fair, the general behaviour of props with a leading colon is explained in the docs, in the chapter about Data Binding Syntax and their shortcuts: http://vuejs.org/guide/syntax.html#v-bind-Shorthand
But I can see how that is not obvious to someone scanning the docs for a specific topic.
I therefore think we should try and change docs to use the longhand version for all bindings (
v-bind:prop-name="expression"
).So the example would then look like this:
Which would tell someone new to Vue that he/she has to look up
v-bind
in order to fully get what is going on.