Newer
Older

robinwilliam.hundt
committed
<template>
<v-btn v-if="hint"
color="error"
@click="toggleEditor"
>
{{ lineNo }}
</v-btn>
<v-btn
v-else
block
depressed
class="line-number-btn"
@click="toggleEditor"
>
{{ lineNo }}
</v-btn>
</td>
<td class="code-cell-content pl-2">
<span v-html="code" class="code-line"></span>
<slot/>
</td>
</div>

robinwilliam.hundt
committed
</template>
<script>
export default {
name: 'submission-line',
props: {
lineNo: {
type: String,
required: true

robinwilliam.hundt
committed
},
code: {
type: String,
required: true
},
codeLanguage: {
type: String,
default: 'lang-c'
},
hint: {
type: Boolean,
default: false,
},
},
methods: {
toggleEditor () {
this.$emit('toggleEditor')

robinwilliam.hundt
committed
}
}

robinwilliam.hundt
committed
</script>
<style scoped>
.line-number-cell {
vertical-align: top;
}
.code-cell-content {
width: 100%;
}
.code-line {
white-space: pre-wrap;
font-family: monospace;

robinwilliam.hundt
committed
}
.line-number-btn {
height: fit-content;
min-width: 50px;
margin: 0;
border-radius: 0;

robinwilliam.hundt
committed
}
</style>