Добавил параметры роута
This commit is contained in:
@@ -50,6 +50,10 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
if (!localStorage.getItem("medicalId")) this.$router.push("/calendar");
|
if (!localStorage.getItem("medicalId")) this.$router.push("/calendar");
|
||||||
this.$store.dispatch("getMedicalCardData");
|
this.$store.dispatch("getMedicalCardData");
|
||||||
|
this.$router.push({
|
||||||
|
name: "medical",
|
||||||
|
params: { id: localStorage.getItem("medicalCardId") },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ export default createRouter({
|
|||||||
{ path: "clients", component: TheUser },
|
{ path: "clients", component: TheUser },
|
||||||
{ path: "medcards", component: TheMedcards },
|
{ path: "medcards", component: TheMedcards },
|
||||||
{ path: "settings", component: TheSettings },
|
{ path: "settings", component: TheSettings },
|
||||||
{ path: "medical-card", component: TheMedicalCard },
|
{
|
||||||
|
name: "medical",
|
||||||
|
path: "medical-card/:id?",
|
||||||
|
component: TheMedicalCard,
|
||||||
|
},
|
||||||
{ path: "create-medical-card", component: TheCreateMedicalCard },
|
{ path: "create-medical-card", component: TheCreateMedicalCard },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -464,6 +464,7 @@ const actions = {
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return this.createMedicalCard(localStorage.getItem("medicalId"));
|
return this.createMedicalCard(localStorage.getItem("medicalId"));
|
||||||
}
|
}
|
||||||
|
localStorage.setItem("medicalCardId", data.id);
|
||||||
commit("setMedicalCard", data);
|
commit("setMedicalCard", data);
|
||||||
commit("setBasicData");
|
commit("setBasicData");
|
||||||
commit("setContactsData");
|
commit("setContactsData");
|
||||||
|
|||||||
Reference in New Issue
Block a user