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

Export the component directly #640

Open
TheJaredWilcurt opened this issue Jan 12, 2024 · 0 comments
Open

Export the component directly #640

TheJaredWilcurt opened this issue Jan 12, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@TheJaredWilcurt
Copy link

TheJaredWilcurt commented Jan 12, 2024

Allow for importing the component directly into where it will be used to allow for easy adoption, code-splitting, lazy-loading, tree-shaking, etc. Being able to globally install a component is useful is some contexts but in most cases you are better off importing it in the specific places using it.

Desired outcome:

<template>
  <TimeAgo :datetime="new Date()" />
</template>

<script>
import { TimeAgo } from 'vue-timeago3';

export default {
  name: 'AnExample',
  components: {
    TimeAgo
  }
};
</script>

Also update README to document this approach once supported. The import statement is the one line that could be changed, as long as the rest works. Like something like this would be fine by me:

import TimeAgo from 'vue-timeago3/dist/TimeAgo.vue';
@0x0dr1y 0x0dr1y added enhancement New feature or request good first issue Good for newcomers labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants