This commit is contained in:
Saifeddine ALOUI 2023-08-21 22:07:24 +02:00
parent fa7f180cb7
commit 4786cfc5a9

View File

@ -5,19 +5,19 @@
<button @click="execute">Execute</button> <button @click="execute">Execute</button>
<pre v-if="result">{{ result }}</pre> <pre v-if="result">{{ result }}</pre>
</div> </div>
</template> </template>
<script> <script>
import * as IPython from 'jupyter'; import * as IPython from 'jupyter';
export default { export default {
data() { data() {
return { return {
input: '', input: '',
result: '', result: '',
}; };
}, },
mounted() { mounted() {
const widget = this.$refs.console; const widget = this.$refs.console;
if (widget) { if (widget) {
// Initialize the IPython console with the existing DOM node. // Initialize the IPython console with the existing DOM node.
@ -32,8 +32,8 @@
this.execute(); this.execute();
}); });
} }
}, },
methods: { methods: {
execute() { execute() {
const widget = this.$refs.console; const widget = this.$refs.console;
const code = this.input; const code = this.input;
@ -48,6 +48,6 @@
} }
}); });
}, },
}, },
}; };
</script> </script>