Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 更新商店页面 #122

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/store/components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ onMounted(async () => {
description.value = props.item.description
author.value = props.item.author
homepage.value = props.item.homepage
tags.value = props.item.tags.split(',').filter(tag => tag !== '')
tags.value = props.item.tags.split(/[,\s]/).filter(tag => tag !== '')
return
}

Expand All @@ -31,13 +31,13 @@ onMounted(async () => {
).json()
if (pypiJson.value != null) {
description.value = pypiJson.value.info.summary
if (pypiJson.value.info.author.length > 0)
if (pypiJson.value.info.author?.length)
author.value = pypiJson.value.info.author
else
author.value = pypiJson.value.info.author_email.match(/([^<]*)\s*<.*?>/)?.[1].trim() ?? ''
homepage.value = pypiJson.value.info.project_urls.Homepage ?? ''
homepage.value = pypiJson.value.info.project_urls.Repository ?? pypiJson.value.info.project_urls.Homepage ?? ''
tags.value = pypiJson.value.info.keywords
.split(',')
.split(/[,\s]/)
.filter(tag => tag !== '') ?? []
}
})
Expand Down
2 changes: 1 addition & 1 deletion docs/store/components/StoreList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ watchEffect(async () => {
</div>
<Pagination key="topPagination" v-model="pageNumber" :total="pageTotal" />
<div class="grid grid-cols-1 gap-6 md:grid-cols-2">
<Card v-for="(item, index) in pageItems" :key="index" :item="item" />
<Card v-for="(item, index) in pageItems" :key="index.toString() + item.name" :item="item" />
</div>
<Pagination key="bottomPagination" v-model="pageNumber" :total="pageTotal" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/store/components/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface PyPIData {
info: {
author: string
author: string | null
author_email: string
classifiers: string[]
description: string
Expand All @@ -16,7 +16,7 @@ export interface PyPIData {
package_url: string
platform: null
project_url: string
project_urls: { [key: string]: string }
project_urls: { [key: string]: string | undefined }
release_url: string
requires_dist: string[]
requires_python: string
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
"eslint:fix": "eslint . --fix"
},
"dependencies": {
"@iconify-json/mdi": "^1.1.64",
"unocss": "^0.58.6",
"vitepress": "^1.0.1",
"vue": "^3.4.21"
"@iconify-json/mdi": "^1.1.66",
"unocss": "^0.58.9",
"vitepress": "^1.1.3",
"vue": "^3.4.25"
},
"devDependencies": {
"@antfu/eslint-config": "^2.9.0",
"@types/node": "^20.11.30",
"@unocss/eslint-plugin": "^0.58.6",
"@antfu/eslint-config": "^2.16.0",
"@types/node": "^20.12.7",
"@unocss/eslint-plugin": "^0.58.9",
"conventional-changelog-cli": "^4.1.0",
"eslint": "^8.57.0",
"markdownlint-cli2": "^0.8.1",
"prettier": "^3.2.5",
"pyright": "^1.1.355",
"pyright": "^1.1.360",
"zhlint": "^0.8.1"
},
"pnpm": {
Expand Down
Loading
Loading