setup版本代码优化

This commit is contained in:
piexlmax
2021-12-31 03:04:38 +08:00
parent 7fd4b1d0f5
commit 236d3c7f33
11 changed files with 80 additions and 41 deletions
+4 -2
View File
@@ -116,14 +116,14 @@ export default {
<script setup>
import { ref } from 'vue'
import { Commits, Members } from '@/api/github'
const members = ref([])
const dataTimeline = ref([])
const page = ref(0)
const loadMore = () => {
page.value++
loadCommits()
}
const dataTimeline = ref([])
const loadCommits = () => {
Commits(page.value).then(({ data }) => {
data.forEach((element) => {
@@ -138,6 +138,8 @@ const loadCommits = () => {
})
})
}
const members = ref([])
const loadMembers = () => {
Members().then(({ data }) => {
members.value = data