debian-mirror-gitlab/app/assets/javascripts/notebook/cells/output/image.vue

42 lines
750 B
Vue
Raw Normal View History

2017-08-17 22:00:37 +05:30
<script>
2018-12-13 13:39:08 +05:30
import Prompt from '../prompt.vue';
2017-08-17 22:00:37 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
prompt: Prompt,
},
props: {
2019-03-02 22:35:43 +05:30
count: {
type: Number,
required: true,
},
2018-12-13 13:39:08 +05:30
outputType: {
type: String,
required: true,
2017-08-17 22:00:37 +05:30
},
2018-12-13 13:39:08 +05:30
rawCode: {
type: String,
required: true,
2017-08-17 22:00:37 +05:30
},
2019-03-02 22:35:43 +05:30
index: {
type: Number,
required: true,
},
},
computed: {
imgSrc() {
2019-10-12 21:52:04 +05:30
return `data:${this.outputType};base64,${this.rawCode}`; // eslint-disable-line @gitlab/i18n/no-non-i18n-strings
2019-03-02 22:35:43 +05:30
},
showOutput() {
return this.index === 0;
},
2018-12-13 13:39:08 +05:30
},
};
2017-08-17 22:00:37 +05:30
</script>
2018-03-17 18:26:18 +05:30
<template>
2019-03-02 22:35:43 +05:30
<div class="output">
<prompt type="out" :count="count" :show-output="showOutput" /> <img :src="imgSrc" />
</div>
2018-03-17 18:26:18 +05:30
</template>