| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <template>
- <div class="line-wrap" :style="{background : color}" :class="{'first-line' : isFirst, 'last-line' : isLast}">
- <pre :id="text" v-bind:class="{ 'match-line' : color !== '#ECECEC' }">{{ lineNumber }} {{ text }}</pre>
- </div>
- </template>
- <script>
- import { defineComponent } from "vue";
- export default defineComponent({
- name: "LineOfCode",
- props: {
- text: {
- type: String,
- required: true
- },
- lineNumber: {
- type: Number,
- required: true
- },
- color: {
- required:true
- },
- startOfMatch: {
- type: Number
- },
- fileIndex: {
- type: Number,
- },
- isFirst: {
- type: Boolean,
- },
- isLast: {
- type: Boolean,
- }
- },
- setup(props) {
- console.log(props.color)
- return {
- }
- }
- })
- </script>
- <style scoped>
- pre {
- margin: 0;
- padding: 0;
- float: left;
- font-family: "JetBrains Mono",serif;
- font-size: x-small;
- }
- .first-line {
- margin-top: 2%;
- }
- .last-line {
- margin-bottom: 2%;
- box-shadow: #777777 0 3px 3px;
- }
- .match-line {
- }
- .line-wrap {
- width: 200%;
- }
- </style>
|