Skip to content

Commit

Permalink
fix: let hot reloading work in Voila
Browse files Browse the repository at this point in the history
  • Loading branch information
mariobuikhuizen committed Nov 17, 2021
1 parent a33560c commit 24f829e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion share/jupyter/nbconvert/templates/jdaviz-default/app.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% raw -%}
<div id="web-app" style="display: none">
<v-app >
<v-app :key="forceUpdateTrigger">
<v-slide-y-transition>
<v-layout v-show="loading" align-center justify-center>
<v-card style="min-width: 600px">
Expand Down Expand Up @@ -65,12 +65,20 @@ <h1>{{ loading_text }}</h1>
},
}),
el: '#web-app',
created() {
const original_$forceUpdate = this.$forceUpdate.bind(this);
this.$forceUpdate = (() => {
this.forceUpdateTrigger += 1;
original_$forceUpdate();
});
},
mounted() {
document.querySelector('#web-app').removeAttribute("style");
this.$vuetify.theme.dark = !!document.querySelector('body.theme-dark');
},
data() {
return {
forceUpdateTrigger: 0,
loading_text: "Loading page",
loadingPercentage: -1,
loading: true,
Expand Down

0 comments on commit 24f829e

Please sign in to comment.