More reactive import

This commit is contained in:
chris2fr 2020-10-26 04:40:11 +01:00
parent 7a9906c742
commit 50f8aab655
1 changed files with 10 additions and 3 deletions

View File

@ -16,8 +16,9 @@ var importComponent = {
{
return {
item: {},
json: ""
};
json: "",
versions: []
}
},
methods: {
@ -34,7 +35,13 @@ var importComponent = {
storage.setLocalStorage("sections", this.$root.sections);
storage.setVersionedLocalStorage(this.$root.sections.meta.version, "sections", this.$root.sections);
this.$root.currentVersion = this.$root.sections.meta.version;
storage.setVersionedLocalStorage(this.$root.currentVersion, "sections", this.$root.sections);
if (this.$root.versions.indexOf(this.$root.currentVersion) < 0) {
this.$root.versions.push(this.$root.currentVersion)
}
router.push("section/basics");
},