@@ -7,14 +7,12 @@ import {
77 fontSizeOptions ,
88 legendOptions ,
99 themeOptions ,
10- widthOptions ,
1110} from ' @md/shared/configs'
12- import { Moon , Sun , X } from ' lucide-vue-next'
11+ import { X } from ' lucide-vue-next'
1312import PickColors from ' vue-pick-colors'
14- import { useDisplayStore , useStore } from ' @/stores'
13+ import { useStore } from ' @/stores'
1514
1615const store = useStore ()
17- const displayStore = useDisplayStore ()
1816
1917// 控制是否启用动画
2018const enableAnimation = ref (false )
@@ -32,11 +30,7 @@ watch(() => store.isMobile, () => {
3230 enableAnimation .value = false
3331})
3432
35- const { isDark, primaryColor } = storeToRefs (store )
36-
37- function customStyle() {
38- displayStore .toggleShowCssEditor ()
39- }
33+ const { primaryColor } = storeToRefs (store )
4034
4135const isOpen = ref (false )
4236
@@ -282,75 +276,6 @@ const formatOptions = ref<Format[]>([`rgb`, `hex`, `hsl`, `hsv`])
282276 </Button >
283277 </div >
284278 </div >
285- <div class =" space-y-2" >
286- <h2 >自定义 CSS 面板</h2 >
287- <div class =" grid grid-cols-5 justify-items-center gap-2" >
288- <Button
289- class =" w-full" variant =" outline" :class =" {
290- 'border-black dark:border-white border-2': displayStore.isShowCssEditor,
291- }" @click =" !displayStore.isShowCssEditor && customStyle()"
292- >
293- 开启
294- </Button >
295- <Button
296- class =" w-full" variant =" outline" :class =" {
297- 'border-black dark:border-white border-2': !displayStore.isShowCssEditor,
298- }" @click =" displayStore.isShowCssEditor && customStyle()"
299- >
300- 关闭
301- </Button >
302- </div >
303- </div >
304- <div class =" space-y-2" >
305- <h2 >编辑区位置</h2 >
306- <div class =" grid grid-cols-5 justify-items-center gap-2" >
307- <Button
308- class =" w-full" variant =" outline" :class =" {
309- 'border-black dark:border-white border-2': store.isEditOnLeft,
310- }" @click =" !store.isEditOnLeft && store.toggleEditOnLeft()"
311- >
312- 左侧
313- </Button >
314- <Button
315- class =" w-full" variant =" outline" :class =" {
316- 'border-black dark:border-white border-2': !store.isEditOnLeft,
317- }" @click =" store.isEditOnLeft && store.toggleEditOnLeft()"
318- >
319- 右侧
320- </Button >
321- </div >
322- </div >
323- <div class =" space-y-2" >
324- <h2 >预览模式</h2 >
325- <div class =" grid grid-cols-5 justify-items-center gap-2" >
326- <Button
327- v-for =" { label, value } in widthOptions" :key =" value" class =" w-full" variant =" outline" :class =" {
328- 'border-black dark:border-white border-2': store.previewWidth === value,
329- }" @click =" store.previewWidthChanged(value)"
330- >
331- {{ label }}
332- </Button >
333- </div >
334- </div >
335- <div class =" space-y-2" >
336- <h2 >模式</h2 >
337- <div class =" grid grid-cols-5 justify-items-center gap-2" >
338- <Button
339- class =" w-full" variant =" outline" :class =" {
340- 'border-black dark:border-white border-2': !isDark,
341- }" @click =" store.toggleDark(false)"
342- >
343- <Sun class =" h-4 w-4" />
344- </Button >
345- <Button
346- class =" w-full" variant =" outline" :class =" {
347- 'border-black dark:border-white border-2': isDark,
348- }" @click =" store.toggleDark(true)"
349- >
350- <Moon class =" h-4 w-4" />
351- </Button >
352- </div >
353- </div >
354279 <div class =" space-y-2" >
355280 <h2 >样式配置</h2 >
356281 <Button variant =" destructive" @click =" store.resetStyleConfirm" >
0 commit comments