feat: 增加ipynb渲染
This commit is contained in:
19
components/RenderJupyterNotebook.vue
Normal file
19
components/RenderJupyterNotebook.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div ref="NotebookFragment" class="notebook-fragment" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Notebook } from "../utils/index";
|
||||
|
||||
export default {
|
||||
name: "RenderJupyterNotebook",
|
||||
props: {
|
||||
notebook: { required: true, type: Object },
|
||||
},
|
||||
async mounted() {
|
||||
const notebook = new Notebook(this.notebook, false);
|
||||
const fragment = await notebook.render();
|
||||
this.$refs.NotebookFragment.appendChild(fragment);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user