Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Export the component directly #640

@TheJaredWilcurt

Description

@TheJaredWilcurt

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';

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions