diff --git a/src/components/SvgPreviewer.vue b/src/components/SvgPreviewer.vue index c4f0e9a..e323f43 100644 --- a/src/components/SvgPreviewer.vue +++ b/src/components/SvgPreviewer.vue @@ -5,8 +5,9 @@ import { download, svgCode2Url } from '~/utils/helper' interface Props { svgCode: string + openOnMount?: boolean } -withDefaults(defineProps(), {}) +const props = withDefaults(defineProps(), {}) const minGap = 20 const $el = ref() @@ -32,6 +33,9 @@ onMounted(() => { else if (hovered.value) preview() }) + + if (props.openOnMount) + preview() }) useEventListener('resize', () => { diff --git a/src/pages/index.vue b/src/pages/index.vue index 316edcd..710fccb 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -145,6 +145,7 @@ function debugPane() {