<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div x-data="{content: '', open: false }">
<button @click="open = !open">Expand</button>
<div>
<textarea x-model="content" rows="5" cols="50" placeholder="请输入内容"></textarea>
</div>
<div x-show="open" x-effect="$el.innerHTML = marked.parse(content)" x-transition>
</div>
</div>
<script type="module">
import Alpine from 'https://esm.run/alpinejs';
import { marked } from 'https://esm.sh/marked';
window.Alpine = Alpine
window.marked = marked
Alpine.start()
</script>
</body>
</html>
标签:marked,window,试用,https,alpinejs,import,Alpine
From: https://www.cnblogs.com/soarowl/p/18585011