Skip to content

Extensible vue components? #6536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tyurderi opened this issue Sep 7, 2017 · 2 comments
Closed

Extensible vue components? #6536

tyurderi opened this issue Sep 7, 2017 · 2 comments

Comments

@tyurderi
Copy link

tyurderi commented Sep 7, 2017

What problem does this feature solve?

The idea is to create components which are able to extend another components templates.

Ofcourse the original components needs some breakpoints (or however they're called) where the extending component can join. For example the original components can define "blocks" which just have some content. A block as a name, a start and an end - somehow just a simple html tag.

Then the extending component is able to overwrite, prepend or append the block - identified by its name.

This would be useful if you want to build an extensible website to give developers the ability to extend your components without editing the components code itself - to keep it update-safe.

What does the proposed API look like?

OriginalComponent.vue

<template>
    <div class="container">
        <block name="container_body">
            Vue
        </block>
    </div>
</template>

ExtendingComponent.vue

<extends file="path/to/OriginalComponent.vue">
     <block name="container" append>
           is awesome.
     </block>
</extends>

The rendered result then should look like:

<div class="container">
    Vue is awesome.
</div>

Ofcourse, the ExtendingComponent.vue has to be imported somewhere (outside of the OriginalComponent.vue).

Thats just the basic idea of it. Ofcourse it could be extended to extend the vue components script - and so on.

@posva
Copy link
Member

posva commented Sep 7, 2017

Dup of #5401

@posva posva closed this as completed Sep 7, 2017
@tyurderi
Copy link
Author

tyurderi commented Sep 7, 2017

:( fak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants