Can Component not have a template?
See original GitHub issueIn some scenes, maybe one model needs to have several children models in its scope because childs need to share data and methods of their parent midel, like below.
<div id="parent">
<!-- model parent -->
<div id="child1">
<!-- model child1 -->
</div>
<div id="child2">
<!-- model child2 -->
</div>
...
</div>
I have tried the simplest way, but it didn’t work. There is one effective model, the parent.
var parent=new Vue({
el:'#parent',
...
});
var child1=new Vue({
el:'#child1',
...
});
..
Then I thought components should be used. But I didn’t want to make a component, but a thing like controller in angular. Can I just do this?
Vue.component('child1',{
inherit:true,
el:'#child',
...
});
or like below?
var child1=parent.$addChild({
inherit:true,
el:'#child1',
...
});
Vue is awesome, but components may be too heavy for such scenes I have mentioned. By the way, it seems that chrome app doesn’t support component system, it give an error like this:
Uncaught TypeError: Cannot read property '$before' of undefined vue.min.js:7
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
In Angular2 I have a component that doesnt require a template ...
1 Answer 1 · 1. I've made that change, now I get this error: ReferenceError: Directive is not defined · 2. import {...
Read more >Introduction to components and templates - Angular
A component controls a patch of screen called a view. It consists of a TypeScript class, an HTML template, and a CSS style...
Read more >Component Templates in a Workspace Connected to Altium ...
When connected to an Altium 365 Workspace, note that Component Templates are not supported with the Altium Designer Standard Subscription. As ...
Read more >3.3 Template Components - CT.gov
This section will give an overview of OpenRoads Template Components. ... Moving one point has no impact on the other points that make...
Read more >Component Templates - Apache Tapestry
If a component does not have a template, but extends from a component class that does have a template, then the parent class'...
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
inline-template
now indev
: https://github.com/yyx990803/vue/commit/bd47f1c71e9826f6e42cb9056829f58cc7681c05Just a random idea, maybe an attribute flag, e.g.
<div v-component="x" inline-template>
, which indicates that you don’t want content transclusion for what’s inside the component?