diff --git a/.vscode/settings.json b/.vscode/settings.json index 39a5287a..2ed64c2a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,7 +24,7 @@ }, // Vue "[vue]": { - "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "editor.defaultFormatter": "Wscats.vue", }, // Extension: Volar "volar.preview.port": 3000, diff --git a/package.json b/package.json index 809fa581..3b13af6c 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "@iconify/tools": "^2.2.0", "@iconify/vue": "4.1.1", "@intlify/unplugin-vue-i18n": "^0.10.0", + "@tailwindcss/aspect-ratio": "^0.4.2", "@types/node": "^20.1.4", "@types/webfontloader": "^1.6.34", "@typescript-eslint/eslint-plugin": "^5.59.5", diff --git a/src/components/cards/MediaCard.vue b/src/components/cards/MediaCard.vue index 349d00b5..8312b769 100644 --- a/src/components/cards/MediaCard.vue +++ b/src/components/cards/MediaCard.vue @@ -3,7 +3,9 @@ import { MediaInfo } from "@/api/types"; // 输入参数 const props = defineProps({ - media: Object as PropType + media: Object as PropType, + width: String, + height: String, }); // 图片加载状态 @@ -18,71 +20,86 @@ const getChipColor = (type: string) => { return "border-purple-600 bg-purple-600"; } }; - + diff --git a/src/styles/styles.scss b/src/styles/styles.scss index 5f0a065f..4444f9de 100644 --- a/src/styles/styles.scss +++ b/src/styles/styles.scss @@ -2,17 +2,3 @@ @tailwind base; @tailwind components; @tailwind utilities; - -.grid-media-card { - grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr)); -} - -.media-slide-card { - position: relative; - flex: 0 0 auto; - max-width: 11rem; -} - -.grid-subscribe-card { - grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); -} diff --git a/src/views/discover/MediaCardListView.vue b/src/views/discover/MediaCardListView.vue index 00067e16..35618e64 100644 --- a/src/views/discover/MediaCardListView.vue +++ b/src/views/discover/MediaCardListView.vue @@ -8,8 +8,6 @@ const props = defineProps({ apipath: String, }); -console.log(props.apipath) - // 当前页码 const page = ref(1); // 是否加载中 @@ -22,8 +20,8 @@ const currData = ref([]); // 获取订阅列表数据 const fetchData = async ({ done }) => { try { - if (!props.apipath){ - return + if (!props.apipath) { + return; } // 如果正在加载中,直接返回 if (loading.value) { @@ -45,10 +43,9 @@ const fetchData = async ({ done }) => { } finally { // 取消加载中 loading.value = false; - done('ok') + done("ok"); } }; -