2017-08-17 22:00:37 +05:30
|
|
|
<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>
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
<template>
|
|
|
|
<div class="cell">
|
|
|
|
<code-cell
|
|
|
|
:raw-code="rawInputCode"
|
|
|
|
:count="cell.execution_count"
|
2018-11-08 19:23:39 +05:30
|
|
|
:code-css-class="codeCssClass"
|
|
|
|
type="input" />
|
2018-03-17 18:26:18 +05:30
|
|
|
<output-cell
|
|
|
|
v-if="hasOutput"
|
|
|
|
:count="cell.execution_count"
|
|
|
|
:output="output"
|
|
|
|
:code-css-class="codeCssClass" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
<style scoped>
|
|
|
|
.cell {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
</style>
|