From bb983701dfbd4a8a5e29572e225727321a8db428 Mon Sep 17 00:00:00 2001
From: gwen
Date: Mon, 26 Feb 2024 15:57:01 +0100
Subject: [PATCH 1/5] ajouter vue router4
---
science-quest/package.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/science-quest/package.json b/science-quest/package.json
index 88c6a27..9142ee4 100644
--- a/science-quest/package.json
+++ b/science-quest/package.json
@@ -9,7 +9,8 @@
"preview": "vite preview"
},
"dependencies": {
- "vue": "^3.4.15"
+ "vue": "^3.4.15",
+ "vue-router": "^4.3.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.3",
--
2.36.3
From 87f02c9bdbec64e85ffa7a7b51367672e5e3bfe0 Mon Sep 17 00:00:00 2001
From: gwen
Date: Mon, 26 Feb 2024 16:20:18 +0100
Subject: [PATCH 2/5] vider app.vue
---
science-quest/src/App.vue | 26 +-------------------------
1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/science-quest/src/App.vue b/science-quest/src/App.vue
index a702626..f698c64 100644
--- a/science-quest/src/App.vue
+++ b/science-quest/src/App.vue
@@ -1,31 +1,7 @@
@@ -36,7 +12,7 @@ export default {
-
+
--
2.36.3
From cafcf81cbcfc3667d5360208cf9a984cf506a243 Mon Sep 17 00:00:00 2001
From: gwen
Date: Mon, 26 Feb 2024 16:20:39 +0100
Subject: [PATCH 3/5] mettre routes dans main.js et creer testparametreurl
---
.../src/components/TestParametreURL.vue | 3 +++
science-quest/src/main.js | 21 ++++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 science-quest/src/components/TestParametreURL.vue
diff --git a/science-quest/src/components/TestParametreURL.vue b/science-quest/src/components/TestParametreURL.vue
new file mode 100644
index 0000000..718f888
--- /dev/null
+++ b/science-quest/src/components/TestParametreURL.vue
@@ -0,0 +1,3 @@
+
+ {{ $route.params.id }}
+
\ No newline at end of file
diff --git a/science-quest/src/main.js b/science-quest/src/main.js
index 0ac3a5f..d8c433a 100644
--- a/science-quest/src/main.js
+++ b/science-quest/src/main.js
@@ -1,6 +1,25 @@
import './assets/main.css'
+import { createRouter, createWebHashHistory } from 'vue-router'
import { createApp } from 'vue'
import App from './App.vue'
-createApp(App).mount('#app')
+//importer les components pour le routing
+import PagePrincipale from "./components/PagePrincipale.vue"
+import NotFound from "./components/erreurs/NotFound.vue"
+import TestParametreURL from "./components/TestParametreURL.vue"
+
+const routes = [
+ { path: '/', component: PagePrincipale },
+ { path: '/exemple/:id', component: TestParametreURL },
+ { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
+]
+
+const router = createRouter({
+ // 4. Provide the history implementation to use. We
+ // are using the hash history for simplicity here.
+ history: createWebHashHistory(),
+ routes, // short for `routes: routes`
+})
+
+createApp(App).use(router).mount('#app')
--
2.36.3
From b7d8354d45b56d948bb0b7594dfbda7bee2a64db Mon Sep 17 00:00:00 2001
From: gwen
Date: Mon, 26 Feb 2024 16:22:28 +0100
Subject: [PATCH 4/5] enlever commentaire
---
science-quest/src/main.js | 2 --
1 file changed, 2 deletions(-)
diff --git a/science-quest/src/main.js b/science-quest/src/main.js
index d8c433a..ba7661e 100644
--- a/science-quest/src/main.js
+++ b/science-quest/src/main.js
@@ -16,8 +16,6 @@ const routes = [
]
const router = createRouter({
- // 4. Provide the history implementation to use. We
- // are using the hash history for simplicity here.
history: createWebHashHistory(),
routes, // short for `routes: routes`
})
--
2.36.3
From 4fd794fcab7d1d9aa9c3430383a52a71b3f63080 Mon Sep 17 00:00:00 2001
From: gwen
Date: Mon, 26 Feb 2024 16:23:07 +0100
Subject: [PATCH 5/5] enlever components de base
---
science-quest/src/components/HelloWorld.vue | 44 ----------
science-quest/src/components/TheWelcome.vue | 88 -------------------
science-quest/src/components/WelcomeItem.vue | 87 ------------------
.../src/components/icons/IconCommunity.vue | 7 --
.../components/icons/IconDocumentation.vue | 7 --
.../src/components/icons/IconEcosystem.vue | 7 --
.../src/components/icons/IconSupport.vue | 7 --
.../src/components/icons/IconTooling.vue | 19 ----
8 files changed, 266 deletions(-)
delete mode 100644 science-quest/src/components/HelloWorld.vue
delete mode 100644 science-quest/src/components/TheWelcome.vue
delete mode 100644 science-quest/src/components/WelcomeItem.vue
delete mode 100644 science-quest/src/components/icons/IconCommunity.vue
delete mode 100644 science-quest/src/components/icons/IconDocumentation.vue
delete mode 100644 science-quest/src/components/icons/IconEcosystem.vue
delete mode 100644 science-quest/src/components/icons/IconSupport.vue
delete mode 100644 science-quest/src/components/icons/IconTooling.vue
diff --git a/science-quest/src/components/HelloWorld.vue b/science-quest/src/components/HelloWorld.vue
deleted file mode 100644
index 5fb372c..0000000
--- a/science-quest/src/components/HelloWorld.vue
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
{{ msg }}
-
- You’ve successfully created a project with
- Vite +
- Vue 3 .
-
-
-
-
-
diff --git a/science-quest/src/components/TheWelcome.vue b/science-quest/src/components/TheWelcome.vue
deleted file mode 100644
index dab9536..0000000
--- a/science-quest/src/components/TheWelcome.vue
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
- Documentation
-
- Vue’s
- official documentation
- provides you with all information you need to get started.
-
-
-
-
-
-
- Tooling
-
- This project is served and bundled with
- Vite . The
- recommended IDE setup is
- VSCode +
- Volar . If
- you need to test your components and web pages, check out
- Cypress and
- Cypress Component Testing .
-
-
-
- More instructions are available in README.md
.
-
-
-
-
-
-
- Ecosystem
-
- Get official tools and libraries for your project:
- Pinia ,
- Vue Router ,
- Vue Test Utils , and
- Vue Dev Tools . If
- you need more resources, we suggest paying
- Awesome Vue
- a visit.
-
-
-
-
-
-
- Community
-
- Got stuck? Ask your question on
- Vue Land , our official
- Discord server, or
- StackOverflow . You should also subscribe to
- our mailing list and follow
- the official
- @vuejs
- twitter account for latest news in the Vue world.
-
-
-
-
-
-
- Support Vue
-
- As an independent project, Vue relies on community backing for its sustainability. You can help
- us by
- becoming a sponsor .
-
-
diff --git a/science-quest/src/components/WelcomeItem.vue b/science-quest/src/components/WelcomeItem.vue
deleted file mode 100644
index 6d7086a..0000000
--- a/science-quest/src/components/WelcomeItem.vue
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
diff --git a/science-quest/src/components/icons/IconCommunity.vue b/science-quest/src/components/icons/IconCommunity.vue
deleted file mode 100644
index 2dc8b05..0000000
--- a/science-quest/src/components/icons/IconCommunity.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/science-quest/src/components/icons/IconDocumentation.vue b/science-quest/src/components/icons/IconDocumentation.vue
deleted file mode 100644
index 6d4791c..0000000
--- a/science-quest/src/components/icons/IconDocumentation.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/science-quest/src/components/icons/IconEcosystem.vue b/science-quest/src/components/icons/IconEcosystem.vue
deleted file mode 100644
index c3a4f07..0000000
--- a/science-quest/src/components/icons/IconEcosystem.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/science-quest/src/components/icons/IconSupport.vue b/science-quest/src/components/icons/IconSupport.vue
deleted file mode 100644
index 7452834..0000000
--- a/science-quest/src/components/icons/IconSupport.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/science-quest/src/components/icons/IconTooling.vue b/science-quest/src/components/icons/IconTooling.vue
deleted file mode 100644
index 660598d..0000000
--- a/science-quest/src/components/icons/IconTooling.vue
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
--
2.36.3