diff options
author | Phil Hughes <me@iamphill.com> | 2017-04-11 20:50:21 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-04-11 20:50:21 +0300 |
commit | 4755f6066bff2617988704e18c8c141056f1b4bd (patch) | |
tree | 7e1c58dfdc96134f7d2594bf63d2be226a98b4d7 /app/assets/javascripts/notebook/cells/code.vue | |
parent | 3082a1195cc0939e0aa0b48a9f59dd84152ebdad (diff) |
Moved NotebookLab assets into repo
Moved all the notebooklab assets into the GitLab repo
Diffstat (limited to 'app/assets/javascripts/notebook/cells/code.vue')
-rw-r--r-- | app/assets/javascripts/notebook/cells/code.vue | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/app/assets/javascripts/notebook/cells/code.vue b/app/assets/javascripts/notebook/cells/code.vue new file mode 100644 index 00000000000..b8a16356576 --- /dev/null +++ b/app/assets/javascripts/notebook/cells/code.vue @@ -0,0 +1,58 @@ +<template> + <div class="cell"> + <code-cell + type="input" + :raw-code="rawInputCode" + :count="cell.execution_count" + :code-css-class="codeCssClass" /> + <output-cell + v-if="hasOutput" + :count="cell.execution_count" + :output="output" + :code-css-class="codeCssClass" /> + </div> +</template> + +<script> +import CodeCell from './code/index.vue'; +import OutputCell from './output/index.vue'; + +export default { + components: { + 'code-cell': CodeCell, + 'output-cell': OutputCell, + }, + props: { + cell: { + type: Object, + required: true, + }, + codeCssClass: { + type: String, + required: false, + default: '', + }, + }, + computed: { + rawInputCode() { + if (this.cell.source) { + return this.cell.source.join(''); + } + + return ''; + }, + hasOutput() { + return this.cell.outputs.length; + }, + output() { + return this.cell.outputs[0]; + }, + }, +}; +</script> + +<style scoped> +.cell { + flex-direction: column; +} +</style> |