|
39 | 39 | </template> |
40 | 40 |
|
41 | 41 | <script lang="ts"> |
42 | | -import { Component, Vue } from 'vue-property-decorator'; |
| 42 | +import { defineComponent } from '@vue/composition-api'; |
43 | 43 | import ExplorerComponent from '@/script/components/EditorComponents/ExplorerComponent.vue'; |
44 | | -import ConsoleComponent from '@/script/components/EditorComponents/ConsoleComponent.vue'; |
45 | 44 | import ViewportComponent from '@/script/components/EditorComponents/ViewportComponent.vue'; |
46 | 45 | import HierarchyComponent from '@/script/components/EditorComponents/HierarchyComponent.vue'; |
47 | 46 | import InspectorComponent from '@/script/components/EditorComponents/Inspector/InspectorComponent.vue'; |
48 | 47 | import HistoryComponent from '@/script/components/EditorComponents/HistoryComponent.vue'; |
49 | 48 | import PerfectScrollbar from 'perfect-scrollbar'; |
50 | 49 |
|
51 | | -@Component({ |
52 | | - components: { |
53 | | - ExplorerComponent, |
54 | | - ConsoleComponent, |
55 | | - ViewportComponent, |
56 | | - HierarchyComponent, |
57 | | - InspectorComponent, |
58 | | - HistoryComponent |
59 | | - } |
60 | | -}) |
61 | | -export default class GoldenLayoutHolder extends Vue { |
62 | | - onInitialised() { |
63 | | - const viewport = document.getElementById('viewport-component'); |
64 | | - if (viewport !== null && viewport.parentElement !== null && viewport.parentElement.parentElement !== null) { |
65 | | - viewport.parentElement.parentElement.setAttribute('id', 'viewport-container'); |
66 | | - } |
67 | | - this.onMount(); |
68 | | - } |
| 50 | +export default defineComponent({ |
| 51 | + name: 'GoldenLayoutHolder', |
| 52 | + components: { |
| 53 | + ExplorerComponent, |
| 54 | + ViewportComponent, |
| 55 | + HierarchyComponent, |
| 56 | + InspectorComponent, |
| 57 | + HistoryComponent |
| 58 | + }, |
| 59 | + methods: { |
| 60 | + onInitialised() { |
| 61 | + const viewport = document.getElementById('viewport-component'); |
| 62 | + if (viewport !== null && viewport.parentElement !== null && viewport.parentElement.parentElement !== null) { |
| 63 | + viewport.parentElement.parentElement.setAttribute('id', 'viewport-container'); |
| 64 | + } |
| 65 | + this.onMount(); |
| 66 | + }, |
69 | 67 |
|
70 | | - onStackCreated(stack: any) { |
71 | | - this.$nextTick(() => { |
72 | | - if (stack.contentItems.length > 0) { |
73 | | - if (!stack.contentItems[0].vueObject.$vnode.context.showHeader) { |
74 | | - stack.header.position(); |
75 | | - } |
76 | | - } |
77 | | - }); |
78 | | - } |
| 68 | + onStackCreated(stack: any) { |
| 69 | + this.$nextTick(() => { |
| 70 | + if (stack.contentItems.length > 0) { |
| 71 | + if (!stack.contentItems[0].vueObject.$vnode.context.showHeader) { |
| 72 | + stack.header.position(); |
| 73 | + } |
| 74 | + } |
| 75 | + }); |
| 76 | + }, |
79 | 77 |
|
80 | | - onMount() { |
81 | | - this.$nextTick(() => { |
82 | | - (this.$refs.gl as any).layout.onResize(); |
83 | | - const scrollables = document.getElementsByClassName('scrollable'); |
84 | | - for (const scrollable of scrollables as any) { |
85 | | - new PerfectScrollbar(scrollable as HTMLElement, { |
86 | | - minScrollbarLength: 35 |
87 | | - }); |
88 | | - } |
89 | | - }); |
90 | | - } |
91 | | -} |
| 78 | + onMount() { |
| 79 | + this.$nextTick(() => { |
| 80 | + (this.$refs.gl as any).layout.onResize(); |
| 81 | + const scrollables = document.getElementsByClassName('scrollable'); |
| 82 | + for (const scrollable of scrollables as any) { |
| 83 | + new PerfectScrollbar(scrollable as HTMLElement, { |
| 84 | + minScrollbarLength: 35 |
| 85 | + }); |
| 86 | + } |
| 87 | + }); |
| 88 | + } |
| 89 | + } |
| 90 | +}); |
92 | 91 | </script> |
93 | 92 |
|
94 | 93 | <style> |
|
0 commit comments