This commit is contained in:
2025-10-27 15:55:29 +08:00
commit 6632080b83
513 changed files with 117442 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<template>
<text>{{ temp }}</text>
</template>
<script>
import _time_ from './time.js';
export default {
name: 'l-time',
props: {
//日期字符串
text: {
type: [String, Number, Date],
default: ''
},
//是否显示大于当前时间日期默认false大于显示刚刚
maxDate: {
type: Boolean,
default: false
}
},
data() {
return {
textVal: this.text
};
},
watch: {
text() {
this.textVal = this.text;
}
},
computed: {
temp() {
return this.getText();
}
},
methods: {
getText() {
let self = this;
let timeVal = _time_.getFormatTime(self.textVal, self.maxDate);
if (timeVal && (timeVal.endsWith('刚刚') || timeVal.endsWith('分钟前'))) {
setTimeout(() => {
let temp = self.textVal;
self.textVal = '';
self.textVal = temp;
}, 60000);
}
return this.textVal ? timeVal : '';
},
onClick() {
this.$emit('on-tap', this.textVal);
}
}
};
</script>
<style></style>