Skip to content

Commit

Permalink
[ui] Vue 3 - Migrated HueLink component
Browse files Browse the repository at this point in the history
  • Loading branch information
sreenaths authored and JohanAhlen committed Feb 17, 2021
1 parent 8049ca8 commit 013f647
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions desktop/core/src/desktop/js/components/HueLink.vue
Expand Up @@ -21,32 +21,39 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { onHueLinkClick } from 'utils/hueUtils';
import Vue from 'vue';
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
interface hueWindow {
HUE_BASE_URL: string;
}
@Component
export default class HueLink extends Vue {
@Prop({ required: false })
url?: string;
export default defineComponent({
props: {
url: {
type: String,
required: false,
default: ''
}
},
emits: ['click'],
created(): void {
delete this.$attrs.href;
}
clicked(event: Event): void {
if (this.url) {
onHueLinkClick(event, this.url, this.$attrs.target);
} else {
this.$emit('click');
},
methods: {
clicked(event: Event): void {
if (this.url && this.$attrs.target) {
onHueLinkClick(event, this.url, <string>this.$attrs.target);
} else {
this.$emit('click');
}
}
}
}
});
</script>

<style lang="scss" scoped></style>

0 comments on commit 013f647

Please sign in to comment.