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

44 lines
700 B
Vue
Raw Normal View History

2017-08-17 22:00:37 +05:30
<script>
2018-12-13 13:39:08 +05:30
export default {
props: {
type: {
type: String,
required: false,
default: '',
2018-03-17 18:26:18 +05:30
},
2018-12-13 13:39:08 +05:30
count: {
type: Number,
required: false,
default: 0,
2017-08-17 22:00:37 +05:30
},
2019-03-02 22:35:43 +05:30
showOutput: {
type: Boolean,
required: false,
default: true,
},
2018-12-13 13:39:08 +05:30
},
computed: {
hasKeys() {
return this.type !== '' && this.count;
},
2019-03-02 22:35:43 +05:30
showTypeText() {
return this.type && this.count && this.showOutput;
},
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>
<div class="prompt">
2019-03-02 22:35:43 +05:30
<span v-if="showTypeText"> {{ type }} [{{ count }}]: </span>
2018-03-17 18:26:18 +05:30
</div>
</template>
2017-08-17 22:00:37 +05:30
<style scoped>
2018-12-13 13:39:08 +05:30
.prompt {
padding: 0 10px;
min-width: 7em;
font-family: monospace;
}
2017-08-17 22:00:37 +05:30
</style>