File tree Expand file tree Collapse file tree 1 file changed +24
-17
lines changed
desktop/core/src/desktop/js/components Expand file tree Collapse file tree 1 file changed +24
-17
lines changed Original file line number Diff line number Diff line change 25
25
26
26
<script lang="ts">
27
27
import HueIcon from ' ./HueIcon.vue' ;
28
- import Vue from ' vue' ;
29
- import Component from ' vue-class-component' ;
30
- import { Prop } from ' vue-property-decorator' ;
28
+
29
+ import { defineComponent } from ' vue' ;
31
30
32
31
// TODO: Support additional statuses
33
32
// TODO: Support spinner
34
- const ICON_MAPPING = {
33
+ const ICON_MAPPING: { [ value : string ] : string } = {
35
34
success: ' hi-status-success' ,
36
35
error: ' hi-status-error' ,
37
36
warning: ' hi-status-warning' ,
38
37
stopped: ' hi-status-stopped'
39
38
};
40
39
41
- @Component ({
42
- components: { HueIcon }
43
- })
44
- export default class StatusIndicator extends Vue {
45
- @Prop ({ required: true , default: ' unknown' })
46
- value: string ;
40
+ export default defineComponent ({
41
+ components: {
42
+ HueIcon
43
+ },
47
44
48
- get icon(): string | null {
49
- return ICON_MAPPING [this .value .toLowerCase ()];
50
- }
45
+ props: {
46
+ value: {
47
+ type: String ,
48
+ required: true ,
49
+ default: ' unknown'
50
+ }
51
+ },
52
+
53
+ computed: {
54
+ icon(): string | undefined {
55
+ return ICON_MAPPING [this .value .toLowerCase ()];
56
+ },
51
57
52
- get spin(): boolean {
53
- const lowerValue = this .value .toLowerCase ();
54
- return lowerValue === ' started' || lowerValue === ' running' ;
58
+ spin(): boolean {
59
+ const lowerValue = this .value .toLowerCase ();
60
+ return lowerValue === ' started' || lowerValue === ' running' ;
61
+ }
55
62
}
56
- }
63
+ });
57
64
</script >
58
65
59
66
<style lang="scss" scoped></style >
You can’t perform that action at this time.
0 commit comments