abichinger / vue-js-cron

Renderless Vue.js cron editor
MIT License
67 stars 23 forks source link

Export VueCronEditor component in Light for Local Registration #18

Closed toshsan closed 1 year ago

toshsan commented 1 year ago

The control is amazing. 👏 Issue: Currently the control to be registered at app global scope (according to the doc). I could not see any exports at index.js that allows local registration.

We should be able to do something like the following: import { VueCronEditor } from "@vue-js-cron/light"

  1. It's a best practice to export both, so users will have a choice.
  2. Happy to make a pull request.

Thanks for the great component.

Note: I was able to destruct the default export like this. But a named export will be great. import cronLight from "@vue-js-cron/light"; import "@vue-js-cron/light/dist/light.css";

const { component: CronLight } = cronLight;

abichinger commented 1 year ago

Hello @toshsan I'm glad you like the component.

Adding named exports seems like a great idea. This issue actually affects all vue-js-cron components. I think all components should have a named export like Cron[package-name].

Happy to wait for your pull request, but if you are busy right now, I can do it myself.

abichinger commented 1 year ago

75f7f18be30f1cd98388869606884659a3346f43 adds named exports. Thank you for the suggestion!