Skip to content

Commit

Permalink
[#1936] Migrate c-segment-collection.vue to typescript (#2036)
Browse files Browse the repository at this point in the history
Currently, there is still some JavaScript code which remains unmigrated.
This allows for type unsafe code to be written, potentially resulting in
unintended behavior.

Let's migrate the rest of the JavaScript code to TypeScript code to
facilitate future changes to the code.
  • Loading branch information
jq1836 committed Oct 4, 2023
1 parent a8c3f00 commit 93e850f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frontend/src/components/c-segment-collection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
c-segment(v-bind:segment="segment", v-bind:path="path")
</template>

<script>
<script lang='ts'>
import { defineComponent } from 'vue';
import cSegment from './c-segment.vue';
import Segment from '../utils/segment';
export default {
export default defineComponent({
name: 'c-segment-collection',
components: {
cSegment,
},
props: {
segments: {
type: Array,
type: Array<Segment>,
required: true,
},
path: {
Expand All @@ -28,11 +30,11 @@ export default {
};
},
methods: {
visibilityChanged(isVisible) {
visibilityChanged(isVisible: boolean) {
if (isVisible) {
this.isRendered = true;
}
},
},
};
});
</script>

0 comments on commit 93e850f

Please sign in to comment.