Site > File > Viewer > Add lines

This commit is contained in:
brunosimon
2017-08-15 23:05:59 +02:00
parent 377a088fcb
commit bfe6fc708b
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -16,6 +16,11 @@ export default
version() version()
{ {
return this.$store.state.files.currentVersion return this.$store.state.files.currentVersion
},
linesCount()
{
return (this.$store.state.files.currentVersion.content.match(/\n/g) || []).length + 1
} }
}, },
+3
View File
@@ -1,3 +1,6 @@
<div class="viewer" v-if="version"> <div class="viewer" v-if="version">
<pre v-highlightjs="version.content" contenteditable @keydown="onCodeKeyDown($event)"><code></code></pre> <pre v-highlightjs="version.content" contenteditable @keydown="onCodeKeyDown($event)"><code></code></pre>
<div class="lines">
<div class="line" v-for="i in linesCount">{{ i }}</div>
</div>
</div> </div>