diff --git a/index.html b/index.html index c232f0f..c599f74 100644 --- a/index.html +++ b/index.html @@ -2,9 +2,9 @@ - + - project-report +
diff --git a/src/components/AchievementList.vue b/src/components/AchievementList.vue index 6e84a4b..3c3f091 100644 --- a/src/components/AchievementList.vue +++ b/src/components/AchievementList.vue @@ -3,6 +3,11 @@ import { ref, reactive, onMounted } from 'vue' import { showToast } from 'vant' import { getAchievementList } from '../services/api' +// 接受父组件传递的配置 +const props = defineProps({ + config: Object +}) + // 搜索关键词 const searchKey = ref('') @@ -84,8 +89,13 @@ const handleDetail = (item) => { } // 下载清单 -const handleDownload = (year) => { - showToast(`${year}清单下载功能开发中`) +const handleDownload = (url) => { + if (url) { + // 直接打开下载链接 + window.open(url, '_blank') + } else { + showToast('下载链接无效') + } } // 页面挂载时获取数据 @@ -98,7 +108,7 @@ onMounted(() => {
-