全屏展示
This commit is contained in:
0
public/usercontent.html
Normal file
0
public/usercontent.html
Normal file
@@ -4,7 +4,10 @@
|
|||||||
<Icon icon="noto:eyes" :width="20"></Icon>
|
<Icon icon="noto:eyes" :width="20"></Icon>
|
||||||
<n-text class="titleText">预览</n-text>
|
<n-text class="titleText">预览</n-text>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
|
<n-flex>
|
||||||
<n-button quaternary @click="download" :disabled="!showDL">下载</n-button>
|
<n-button quaternary @click="download" :disabled="!showDL">下载</n-button>
|
||||||
|
<n-button quaternary @click="open">展示</n-button>
|
||||||
|
</n-flex>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
<iframe class="iframe" ref="iframe"></iframe>
|
<iframe class="iframe" ref="iframe"></iframe>
|
||||||
</template>
|
</template>
|
||||||
@@ -57,6 +60,14 @@ function download() {
|
|||||||
URL.revokeObjectURL(url)
|
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 })
|
watchDebounced([html, css, js], preview, { debounce: 500, maxWait: 1000 })
|
||||||
onMounted(preview)
|
onMounted(preview)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user