瀏覽代碼

[ui] Vue 3 - Migrated HueIcon component

sreenaths 4 年之前
父節點
當前提交
8049ca8ec5
共有 1 個文件被更改,包括 13 次插入10 次删除
  1. 13 10
      desktop/core/src/desktop/js/components/HueIcon.vue

+ 13 - 10
desktop/core/src/desktop/js/components/HueIcon.vue

@@ -23,19 +23,22 @@
 </template>
 
 <script lang="ts">
-  import Vue from 'vue';
-  import Component from 'vue-class-component';
-  import { Prop } from 'vue-property-decorator';
+  import { defineComponent } from 'vue';
 
-  @Component
-  export default class HueIcon extends Vue {
-    @Prop({ required: true })
-    type!: string;
+  export default defineComponent({
+    props: {
+      type: {
+        type: String,
+        required: true
+      }
+    },
 
-    get xlinkAttr(): string {
-      return '#' + this.type;
+    computed: {
+      xlinkAttr(): string {
+        return '#' + this.type;
+      }
     }
-  }
+  });
 </script>
 
 <style lang="scss" scoped>