saberland/saber

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Global components #515

krmax44 posted onGitHub

<!-- Please don't delete this template or we'll close your issue -->

<!-- Before creating an issue please make sure you are using the latest version of Saber. -->

Feature request

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

<!-- Please ask questions via following several ways. -->

<!-- https://chat.saber.land/ -->

<!-- https://stackoverflow.com/questions/ask?tags=saberjs -->

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.


Why not register global components in saber-browser.js

posted by egoist over 5 years ago

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.

posted by krmax44 over 5 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests