|
13 | 13 | ref="editorRef" |
14 | 14 | :path="item.path" |
15 | 15 | :like="like" |
16 | | - @like="() => (open = !open)" |
| 16 | + @like="() => (likeOpen = true)" |
17 | 17 | @diff="(v) => (item.diff = v)" |
18 | 18 | /> |
19 | 19 | </el-tab-pane> |
|
36 | 36 | 保存 |
37 | 37 | </el-button> |
38 | 38 |
|
39 | | - <el-dialog v-model="open" title="偏好设置" width="300"> |
40 | | - <div class="like-dialog"> |
41 | | - <div class="item"> |
42 | | - <div class="label">保存确认</div> |
43 | | - <div class="value"> |
44 | | - <el-switch v-model="like.confirm" inline-prompt /> |
45 | | - </div> |
46 | | - </div> |
47 | | - |
48 | | - <div class="item"> |
49 | | - <div class="label">主题样式</div> |
50 | | - <div class="value"> |
51 | | - <el-select v-model="like.theme" size="small"> |
52 | | - <el-option |
53 | | - v-for="item in THEME_OPTIONS" |
54 | | - :key="item.value" |
55 | | - :label="item.label" |
56 | | - :value="item.value" |
57 | | - /> |
58 | | - </el-select> |
59 | | - </div> |
60 | | - </div> |
61 | | - |
62 | | - <div class="item"> |
63 | | - <div class="label">字体大小</div> |
64 | | - <div class="value"> |
65 | | - <el-input-number v-model="like.fontSize" :min="8" :max="100" size="small" /> |
66 | | - </div> |
67 | | - </div> |
68 | | - </div> |
69 | | - |
70 | | - <template #footer> |
71 | | - <div style="display: flex; align-items: center; margin-top: 32px"> |
72 | | - <el-button size="small" type="danger" @click="resetLike()">恢复默认</el-button> |
73 | | - |
74 | | - <div style="flex: 1"></div> |
75 | | - |
76 | | - <div style="font-size: 12px; color: #999">修改实时生效,且进行缓存</div> |
77 | | - </div> |
78 | | - </template> |
79 | | - </el-dialog> |
| 39 | + <LikeDialog v-model:open="likeOpen" v-model:like="like" @reset="resetLike()" /> |
80 | 40 | </template> |
81 | 41 |
|
82 | 42 | <script setup lang="ts"> |
83 | 43 | import { ref } from 'vue' |
84 | 44 | import { Plus } from '@element-plus/icons-vue' |
85 | 45 |
|
86 | | -import MonacoEditor from './components/MonacoEditor.vue' |
87 | | -
|
88 | | -import { THEME_OPTIONS } from '@/utils/option' |
| 46 | +import MonacoEditor from '@/components/MonacoEditor.vue' |
| 47 | +import LikeDialog from '@/components/LikeDialog.vue' |
89 | 48 |
|
90 | 49 | import useLike from '@/hooks/useLike' |
91 | 50 | import usePath from '@/hooks/usePath' |
92 | 51 |
|
93 | | -const { open, like, resetLike } = useLike() |
| 52 | +const { open: likeOpen, like, resetLike } = useLike() |
94 | 53 | const { view, active, add, remove } = usePath() |
95 | 54 |
|
96 | 55 | const editorRef = ref<any[]>([]) |
|
0 commit comments