mrdeerly / vue-timeago3 Goto Github PK
View Code? Open in Web Editor NEWA tiny timeago component for Vue 3 using date-fns v2.28.
Home Page: https://mrdeerly.github.io/vue-timeago3/
License: MIT License
A tiny timeago component for Vue 3 using date-fns v2.28.
Home Page: https://mrdeerly.github.io/vue-timeago3/
License: MIT License
The automated release workflow publishes the package before the actual build is finished, resulting in empty packages.
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';
Thank you for an awesome library, but there are no types distributed on npm.
In package json, there ar types specified in dist_types
directory which is clearly missing.
Hi,
the new version doesn't work with vite.
17:03:55 [vite] Internal server error: Failed to resolve entry for package "vue-timeago3". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "vue-timeago3". The package may have incorrect main/module/exports specified in its package.json.
Plugin: vite:import-analysis
File: /Users/dspangenberg/Projects/twiceware.cloud/enclosure/src/main.js
at packageEntryFailure (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:40578:11)
at resolvePackageEntry (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:40574:9)
at tryNodeResolve (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:40381:20)
at Context.resolveId (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:40189:28)
at async Object.resolveId (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:38754:32)
at async TransformContext.resolve (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:38528:23)
at async normalizeUrl (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:56682:34)
at async TransformContext.transform (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:56837:57)
at async Object.transform (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:38817:30)
at async doTransform (/Users/dspangenberg/Projects/twiceware.cloud/enclosure/node_modules/vite/dist/node/chunks/dep-3397b401.js:55749:29)
Greetings,
Danny
Hi I'm trying to use vue-timeago3 with Vue.
After following the install instructions I am given an error:
Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'app.config.globalProperties')
I'm using vue 3.2.31, vite 4.0, and bun to install everything. Chances are I'm doing something stupid...
My app.js:
import './bootstrap';
import '../css/map.css';
import { createApp, h } from 'vue';
import App from './MapPages/MapLayout.vue';
import { createPinia } from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import timeago from 'vue-timeago3' // import timeago
const timeagoOptions = {
converterOptions: {
includeSeconds: true,
}
}
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
const app = createApp(App)
app.use(timeago);
app.use(pinia);
app.mount("#app");
And parts of my vue component:
<script setup>
import { ref } from 'vue';
import { settingsStore } from "@/stores/SettingsStore.js";
...
import timeago from 'vue-timeago3'
defineEmits(['close']);
</script>
<template>
...
<timeago :datetime="point.stamp" auto-update />
...
</template>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.