前端页面改造基本完成 待优化
This commit is contained in:
@@ -14,37 +14,37 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Commits } from '@/api/github'
|
||||
import { formatTimeToStr } from '@/utils/date.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
dataTimeline: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadCommits()
|
||||
},
|
||||
methods: {
|
||||
loadCommits() {
|
||||
Commits(0).then(({ data }) => {
|
||||
this.loading = false
|
||||
data.forEach((element, index) => {
|
||||
if (element.commit.message && index < 10) {
|
||||
this.dataTimeline.push({
|
||||
from: formatTimeToStr(element.commit.author.date, 'yyyy-MM-dd'),
|
||||
title: element.commit.author.name,
|
||||
showDayAndMonth: true,
|
||||
message: element.commit.message,
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
name: 'DashboardTable',
|
||||
}
|
||||
</script>
|
||||
<script setup>
|
||||
import { Commits } from '@/api/github'
|
||||
import { formatTimeToStr } from '@/utils/date.js'
|
||||
import { ref } from 'vue-demi'
|
||||
|
||||
const loading = ref(true)
|
||||
const dataTimeline = ref([])
|
||||
|
||||
const loadCommits = () => {
|
||||
Commits(0).then(({ data }) => {
|
||||
loading.value = false
|
||||
data.forEach((element, index) => {
|
||||
if (element.commit.message && index < 10) {
|
||||
dataTimeline.value.push({
|
||||
from: formatTimeToStr(element.commit.author.date, 'yyyy-MM-dd'),
|
||||
title: element.commit.author.name,
|
||||
showDayAndMonth: true,
|
||||
message: element.commit.message,
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
loadCommits()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.commit-table{
|
||||
background-color: #fff;
|
||||
|
||||
Reference in New Issue
Block a user