2
2
import { inject , toRef , computed , Ref } from ' vue'
3
3
import SingleToken from ' ./single.vue'
4
4
5
- const props = defineProps <{ data: any , modified: boolean , start: number }>()
5
+ const props = defineProps <{ data: any ; modified: boolean ; start: number }>()
6
6
const data = toRef (props , ' data' )
7
7
const start = toRef (props , ' start' )
8
8
const startIndex = computed (() => start .value + data .value .startIndex )
@@ -21,35 +21,47 @@ const setCurrent = (prop) => {
21
21
}
22
22
</script >
23
23
24
- <template
25
- ><span @click =" setCurrent('startValue')" :class =" {
26
- 'qutation-start-value': true,
27
- changed: data.startValue !== data.modifiedStartValue,
28
- ignored: 'ignoredStartValue' in data,
29
- [`start-${startIndex}`]: true,
30
- current: current === data && currentProp === 'startValue'
31
- }" >{{
32
- modified ? data.modifiedStartValue : data.startValue
33
- }}</span
34
- ><span v-if =" modified ? data.modifiedInnerSpaceBefore : data.innerSpaceBefore" @click =" setCurrent('innerSpaceBefore')" :class =" {
35
- 'qutation-inner-space-before': true,
36
- changed: data.innerSpaceBefore !== data.modifiedInnerSpaceBefore,
37
- ignored: 'ignoredInnerSpaceBefore' in data,
38
- [`start-${startIndex}`]: true,
39
- current: current === data && currentProp === 'innerSpaceBefore'
40
- }" >{{
41
- modified ? data.modifiedInnerSpaceBefore : data.innerSpaceBefore
42
- }}</span
43
- ><SingleToken v-for =" (token, i) in data.map(x => x)" :key =" i" :data =" token" :modified =" modified" :start =" start"
44
- /><span @click =" setCurrent('endValue')" :class =" {
45
- 'qutation-end-value': true,
46
- changed: data.endValue !== data.modifiedEndValue,
47
- ignored: 'ignoredEndValue' in data,
48
- [`start-${endIndex}`]: true,
49
- current: current === data && currentProp === 'endValue'
50
- }" >{{
51
- modified ? data.modifiedEndValue : data.endValue
52
- }}</span
53
- ></template >
24
+ <template >
25
+ <span
26
+ @click =" setCurrent('startValue')"
27
+ :class =" {
28
+ 'qutation-start-value': true,
29
+ changed: data.startValue !== data.modifiedStartValue,
30
+ ignored: 'ignoredStartValue' in data,
31
+ [`start-${startIndex}`]: true,
32
+ current: current === data && currentProp === 'startValue'
33
+ }"
34
+ >{{ modified ? data.modifiedStartValue : data.startValue }}</span
35
+ ><span
36
+ v-if =" modified ? data.modifiedInnerSpaceBefore : data.innerSpaceBefore"
37
+ @click =" setCurrent('innerSpaceBefore')"
38
+ :class =" {
39
+ 'qutation-inner-space-before': true,
40
+ changed: data.innerSpaceBefore !== data.modifiedInnerSpaceBefore,
41
+ ignored: 'ignoredInnerSpaceBefore' in data,
42
+ [`start-${startIndex}`]: true,
43
+ current: current === data && currentProp === 'innerSpaceBefore'
44
+ }"
45
+ >{{
46
+ modified ? data.modifiedInnerSpaceBefore : data.innerSpaceBefore
47
+ }}</span
48
+ ><SingleToken
49
+ v-for =" (token, i) in data.map((x) => x)"
50
+ :key =" i"
51
+ :data =" token"
52
+ :modified =" modified"
53
+ :start =" start"
54
+ /><span
55
+ @click =" setCurrent('endValue')"
56
+ :class =" {
57
+ 'qutation-end-value': true,
58
+ changed: data.endValue !== data.modifiedEndValue,
59
+ ignored: 'ignoredEndValue' in data,
60
+ [`start-${endIndex}`]: true,
61
+ current: current === data && currentProp === 'endValue'
62
+ }"
63
+ >{{ modified ? data.modifiedEndValue : data.endValue }}</span
64
+ >
65
+ </template >
54
66
55
67
<style scoped src="./labels.css "></style >
0 commit comments