Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Oct 13, 2024
1 parent a9cbe0a commit 3b62894
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
6 changes: 6 additions & 0 deletions src/components/TimeAgo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export default {
this.timeAgo = this.getTimeAgo(new Date(this.date), this.now); // 重新计算
}, 60000); // 每分钟刷新一次
},
watch: {
date() {
// 监听传入的日期变化
this.timeAgo = this.getTimeAgo(new Date(this.date), this.now);
},
},
methods: {
padWithZeros(vNumber, width) {
// 辅助函数:补零操作
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
append-icon="mdi-arrow-right"
>
<span class="hidden-sm-and-down">ZeroCat使用</span>
<span class="hidden-md-and-up"></span>雨云的优质云计算服务
<span class="hidden-md-and-up">使用</span>雨云的优质云计算服务
</v-chip>

<h1 class="text-h4 text-md-h2 font-weight-bold my-6">
Expand Down
5 changes: 3 additions & 2 deletions src/pages/projects/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<v-chip pill prepend-icon="mdi-eye"
>{{ project.view_count }}浏览</v-chip
>
<v-chip pill prepend-icon="mdi-clock">{{ project.time }}</v-chip>
<v-chip pill prepend-icon="mdi-clock"><TimeAgo :date="project.time " /></v-chip>
</div>
<div class="px-4 d-flex ga-2 mb-2">
<v-chip pill prepend-icon="mdi-xml" v-if="project.state == 'public'"
Expand Down Expand Up @@ -105,8 +105,9 @@ import ProjectRunner from "../../../components/ProjectRunner.vue";
import { localuser } from "@/stores/user";
import AddTolist from "../../../components/AddTolist.vue";
import Comment from "../../../components/Comment.vue";
import TimeAgo from "@/components/TimeAgo.vue";
export default {
components: { ProjectRunner },
components: { ProjectRunner,TimeAgo, Comment, AddTolist },
data() {
return {
project: {
Expand Down
22 changes: 3 additions & 19 deletions src/pages/projects/[id]/push.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h1 class="text-h4">推送 <span v-text="project.title"></span></h1>
</div>
<br />
<v-card>
<v-card hover border>
<template v-slot:title>
{{ project.title }}
</template>
Expand All @@ -17,33 +17,17 @@
{{ project.description }}
</template> </v-card
><br />
<v-card>
<v-card hover border>
<template v-slot:title> 你正在推送你的项目 </template>

<template v-slot:subtitle> 等等,确认点事 </template>

<template v-slot:text>
你正在推送
<span v-text="project.title"></span>
,这将会从项目开发分支代码复制到生产分支,并创建一份历史记录,您的用户将会看到新的作品。
,这将会从项目开发分支代码复制到生产分支,并创建一份历史记录,您的用户将会看到新的作品。请确认项目中不含有个人隐私信息,违规的、不适宜分发的内容。建议您在推送前先进行测试,包含正在测试中的内容的版本可以新建项目用于发布,而不是发表在主项目中。
</template>
</v-card>
<!--<v-card>
<template v-slot:title>
您可以执行推送
</template>
<template v-slot:subtitle>
分支保护
</template>
<template v-slot:text> 没有有关的分支保护
</template>
<v-card-actions>
<v-checkbox label="我已了解并确认" v-model="checkprotect"></v-checkbox>
</v-card-actions>
</v-card>-->

<br />
<v-btn
Expand Down

0 comments on commit 3b62894

Please sign in to comment.