<script setup lang="ts" name="dashboard"> const props = defineProps({ name: { type: String, required: true, }, }) const $router = useRouter() const newPage = ref( [ { name: '碳足迹监测', url: 'https://share.shanhaibi.com/641c0c42b4d7e/', }, { name: '碳足迹评价', url: 'https://share.shanhaibi.com/641c0c7ca29db/', }, { name: '碳足迹预警', url: 'https://share.shanhaibi.com/641c0cacce6ed/', }, ], ) const current = () => { console.log(newPage.value.filter(item => item.name === props.name)[0].name) return newPage.value.filter(item => item.name === props.name)[0] } current() onMounted(() => { window.open(current().url, '_blank') $router.push({ path: '/dashboard/index' }) }) </script> <!-- 监测 https://share.shanhaibi.com/641c0c42b4d7e/ --> <!-- 评价 https://share.shanhaibi.com/641c0c7ca29db/ --> <!-- 预警 https://share.shanhaibi.com/641c0cacce6ed/ -->