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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
746 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() {
2020-04-22 19:07:51 +05:30
return `data:${this.outputType};base64,${this.rawCode}`; // eslint-disable-line @gitlab/require-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>