mirror of
https://github.com/bartvdbraak/SlayerWeightCalculator.git
synced 2025-04-27 17:41:22 +00:00
sync instead of emit for configdata
This commit is contained in:
parent
4c2e9183f0
commit
8a7e2a25b2
2 changed files with 14 additions and 12 deletions
|
@ -176,15 +176,11 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeRouteLeave (to, from, next) {
|
|
||||||
this.$emit('update',this.configData);
|
|
||||||
next()
|
|
||||||
},
|
|
||||||
created() {
|
created() {
|
||||||
this.setRemember()
|
this.setRemember()
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
configFile: function () {
|
configFile() {
|
||||||
if (window.File && window.FileReader && window.FileList && window.Blob) {
|
if (window.File && window.FileReader && window.FileList && window.Blob) {
|
||||||
this.readFile(this.configFile);
|
this.readFile(this.configFile);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<main role="main" class="col-md-10 ml-sm-auto col-lg-10 px-4">
|
<main role="main" class="col-md-10 ml-sm-auto col-lg-10 px-4">
|
||||||
<router-view :configData="mainConfig" @update="updateConfig($event)"></router-view>
|
<router-view :configData.sync="mainConfig"></router-view>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -62,15 +62,21 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateConfig(eventData) {
|
},
|
||||||
this.mainConfig = eventData;
|
watch: {
|
||||||
if (localStorage.getItem('remember') === 'true') {
|
mainConfig: {
|
||||||
localStorage.setItem('configData', JSON.stringify(this.mainConfig));
|
handler() {
|
||||||
}
|
if (localStorage.getItem('remember') === 'true') {
|
||||||
|
localStorage.setItem('configData', JSON.stringify(this.mainConfig));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.mainConfig = JSON.parse(localStorage.getItem("configData"));
|
if (localStorage.getItem("configData")) {
|
||||||
|
this.mainConfig = JSON.parse(localStorage.getItem("configData"));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue