Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCan I use a compoent inherit other compoent? #354
Comments
|
@yyx990803 耽误一小会时间,帮我解个惑吧 |
components: {
'table-grid': TableGrid
}The key |
|
Thx |
|
@evan, why is inheritance not recommended? How would you go about using methods of parent component? You wrote in the documentation that we should not rely on |
|
Re: inheritance. It looks like you have confused two things. There's an object oriented inheritance (extending a component from another component), and there's the view hierarchy. Re: method on parent component. If you don't need the result, then Also, vuejs/Discussion is deprecated, you can find support in the gitter chat or on the forum. |
Q1:
Vue.extendcreate a component construct of Vue, override it by pass data or $el to paramsVue.Componentregister a componentBut
How to do component inherit other?is it necessary?
For Example:
TableGrid, TreeGrid inherit Grid
Q2:
a component from
vue.extend. register it byVue.Component('my-component', Vue.extend({}))how to use this in Father Compoent?