|
@@ -21,32 +21,39 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
|
|
+ import { defineComponent } from 'vue';
|
|
|
|
|
+
|
|
|
import { onHueLinkClick } from 'utils/hueUtils';
|
|
import { onHueLinkClick } from 'utils/hueUtils';
|
|
|
- import Vue from 'vue';
|
|
|
|
|
- import Component from 'vue-class-component';
|
|
|
|
|
- import { Prop } from 'vue-property-decorator';
|
|
|
|
|
|
|
|
|
|
interface hueWindow {
|
|
interface hueWindow {
|
|
|
HUE_BASE_URL: string;
|
|
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 {
|
|
created(): void {
|
|
|
delete this.$attrs.href;
|
|
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>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|
|
<style lang="scss" scoped></style>
|