Skip to content
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

Global components #515

Open
krmax44 opened this issue Oct 9, 2019 · 2 comments
Open

Global components #515

krmax44 opened this issue Oct 9, 2019 · 2 comments

Comments

@krmax44
Copy link
Contributor

krmax44 commented Oct 9, 2019

Feature request

Allow the user to register components globally, without digging in configs.

What problem does this feature solve?

When using components like <warning-message>Heads up!</warning-message> oftenly throughout Markdown, it becomes repetetive to add a script block that imports and registers the component.

What does the proposed API look like?

📦 current working directory
 ┣ 📂 theme
     ┣ 📂 components
         ┣ 📂 global
             ┣ 📄 myGlobalThemeComponent.vue
 ┣ 📂 pages
 ┣ 📂 components
     ┣ 📄 myGlobalComponent.vue

Maybe also configurable:

build:
  globalComponents: false # disable it alltogether
  globalComponents: # all Vue files in these folders will be loaded as global components
    - components/
    - theme/foo-bar/

How should this be implemented in your opinion?

Probably as core functionality, possibly as a plugin if desired.

Are you willing to work on this yourself?

Yes.

@egoist
Copy link
Collaborator

egoist commented Oct 9, 2019

Why not register global components in saber-browser.js

@krmax44
Copy link
Contributor Author

krmax44 commented Oct 9, 2019

Why not register global components in saber-browser.js

Did that before, thought it might be handy to do that based on file structure rather than config.

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