Line data Source code
1 16 : <template>
2 29 : <div class="maskEditor_sidePanel">
3 : <div class="maskEditor_sidePanelContainer">
4 : <component :is="currentPanelComponent" />
5 : </div>
6 : </div>
7 : </template>
8 :
9 : <script setup lang="ts">
10 : import { computed } from 'vue'
11 : import type { Component } from 'vue'
12 :
13 : import { Tools } from '#/types'
14 : import { useMaskEditorStore } from '#/maskEditorStore'
15 :
16 : import BrushSettingsPanel from './BrushSettingsPanel.vue'
17 : import ColorSelectSettingsPanel from './ColorSelectSettingsPanel.vue'
18 : import PaintBucketSettingsPanel from './PaintBucketSettingsPanel.vue'
19 :
20 29 : const currentPanelComponent = computed<Component>(() => {
21 34 : const tool = useMaskEditorStore().currentTool
22 :
23 34 : if (tool === Tools.MaskBucket) {
24 0 : return PaintBucketSettingsPanel
25 34 : } else if (tool === Tools.MaskColorFill) {
26 0 : return ColorSelectSettingsPanel
27 : } else {
28 34 : return BrushSettingsPanel
29 : }
30 : })
31 : </script>
|