diff --git a/public/usercontent.html b/public/usercontent.html new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Preview.vue b/src/components/Preview.vue index fadf5eb..96c59cb 100644 --- a/src/components/Preview.vue +++ b/src/components/Preview.vue @@ -4,7 +4,10 @@ 预览 - 下载 + + 下载 + 展示 + @@ -57,6 +60,14 @@ function download() { URL.revokeObjectURL(url) } +function open() { + const newTab = window.open("/usercontent.html") + if (!newTab) return + newTab.document.open() + newTab.document.write(getContent()) + newTab.document.close() +} + watchDebounced([html, css, js], preview, { debounce: 500, maxWait: 1000 }) onMounted(preview)