fix
This commit is contained in:
@@ -13,20 +13,19 @@ function preview() {
|
||||
const doc = iframe.value.contentDocument!
|
||||
doc.open()
|
||||
doc.write(`<!DOCTYPE html>
|
||||
<html lang="zh-Hans-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>预览</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<style>${css.value}</style>
|
||||
</head>
|
||||
<body>
|
||||
${html.value}
|
||||
</body>
|
||||
</html>`)
|
||||
<html lang="zh-Hans-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>预览</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<style>${css.value}</style>
|
||||
</head>
|
||||
<body>
|
||||
${html.value}
|
||||
</body>
|
||||
</html>`)
|
||||
doc.close()
|
||||
}
|
||||
|
||||
watch([html, css], preview)
|
||||
onMounted(preview)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user