File tree Expand file tree Collapse file tree 4 files changed +17
-25
lines changed Expand file tree Collapse file tree 4 files changed +17
-25
lines changed Original file line number Diff line number Diff line change 1
- <script lang="ts">
2
- import {defineComponent } from " vue" ;
3
- import {useExpandedStore } from " ./expansion" ;
1
+ <script setup lang="ts">
2
+ import {computed } from " vue" ;
3
+ import {useExpandedStore } from " ../utils /expansion" ;
4
4
5
- export default defineComponent ({
6
- props: {
7
- id: {
8
- type: String ,
9
- required: true ,
10
- },
11
- },
12
- setup() {
13
- const {toggleExpanded, isExpanded} = useExpandedStore ();
14
- return {
15
- toggleExpanded ,
16
- isExpanded ,
17
- };
18
- },
19
- });
5
+ const props = defineProps <{
6
+ id: string ;
7
+ }>();
8
+
9
+ const {toggleExpanded, isExpanded} = useExpandedStore ();
10
+
11
+ const expanded = computed (() => isExpanded (props .id ));
20
12
</script >
21
13
22
14
<template >
23
15
<tr
24
- @click =" toggleExpanded(id)"
25
- :class =" {toggle: true, toggled: isExpanded(id) }"
16
+ @click =" toggleExpanded(props. id)"
17
+ :class =" {toggle: true, toggled: expanded }"
26
18
>
27
19
<td class =" toggle-arrow" >
28
- {{ isExpanded(id) ? "▼" : "▶" }}
20
+ {{ expanded ? "▼" : "▶" }}
29
21
</td >
30
22
<slot name =" default" />
31
23
</tr >
32
- <tr v-if =" isExpanded(id) " >
33
- <slot name =" collapsed " />
24
+ <tr v-if =" expanded " >
25
+ <slot name =" expanded " />
34
26
</tr >
35
27
</template >
36
28
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ const unit = computed(() => {
136
136
</abbr >
137
137
</td >
138
138
</template >
139
- <template v-slot :collapsed >
139
+ <template v-slot :expanded >
140
140
<td :colspan =" columnCount" >
141
141
<BenchmarkDetail
142
142
:test-case =" comparison.testCase"
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ const unit = computed(() => {
127
127
>
128
128
</td >
129
129
</template >
130
- <template v-slot :collapsed >
130
+ <template v-slot :expanded >
131
131
<td :colspan =" columnCount" >
132
132
<BenchmarkDetailGraph
133
133
:baseArtifact =" commitA"
File renamed without changes.
You can’t perform that action at this time.
0 commit comments