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