[ui] Vue 3 - Migrated TimeAgo component
</template>
<script lang="ts">
+ import { defineComponent } from 'vue';
+
import I18n from '../utils/i18n';
- import Vue from 'vue';
- import Component from 'vue-class-component';
- import { Prop } from 'vue-property-decorator';
const SECOND = { val: 1000, text: 'second' };
const MINUTE = { val: SECOND.val * 60, text: 'minute' };
return I18n('now');
};
- @Component
- export default class TimeAgo extends Vue {
- @Prop({ required: true })
- value!: number;
+ export default defineComponent({
+ props: {
+ value: {
+ type: Number,
+ required: true
+ }
+ },
+ computed: {
// TODO: Add timezone support
- get timeAgo(): string {
+ timeAgo(): string {
return timeAgo(this.value);
}
}
+ });
</script>
<style lang="scss" scoped></style>
