fix: fixing the issues regarding the use of href
This commit is contained in:
parent
d75d45e204
commit
8071c01c5d
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="project">
|
||||
<div @click="goToLink" class="project">
|
||||
<div class="project-header">
|
||||
<h2 @click="goToLink">{{ projectName }}</h2>
|
||||
<h2 >{{ projectName }}</h2>
|
||||
<div class="project-buttons">
|
||||
<button class="contact-btn">Contact</button>
|
||||
</div>
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps } from "vue";
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
|
||||
const props = defineProps<{
|
||||
@ -25,10 +26,17 @@ const props = defineProps<{
|
||||
projectLink: string;
|
||||
}>();
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const goToLink = () => {
|
||||
if (props.projectLink) {
|
||||
router.push(props.projectLink);
|
||||
/*
|
||||
window.location.href = props.projectLink;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -27,12 +27,12 @@ import { ref } from "vue";
|
||||
const projects = ref([
|
||||
{
|
||||
name: "Projet Alpha",
|
||||
link: "/project-alpha.html", // to test
|
||||
link: "/canvas", // to test
|
||||
members: ["Alice", "Bob", "Charlie"],
|
||||
},
|
||||
{
|
||||
name: "Projet Beta",
|
||||
link: "./project-beta.html", // to test
|
||||
link: "./canvas", // to test
|
||||
members: ["David", "Eve", "Frank"],
|
||||
},
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user