当前位置: 首页 > 工具软件 > Vditor > 使用案例 >

再来一篇,在js中引入vditor的用法

谷翰飞
2023-12-01

简单粗暴,上代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- ⚠️生产环境请指定版本号,如 https://cdn.jsdelivr.net/npm/vditor@x.x.x/dist... -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vditor/dist/index.css" />
    <script src="https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js"></script>
</head>
<body>
<div id="vditor" class="vditor"></div>
</body>
</html>
<script>
    const vditor = new Vditor('vditor', {
        "height": 360,
        "theme": "dark",
        "cache": {
            "enable": false
        },
        "preview": {
            "theme": {
                "current": "dark"
            }
        }
    })
</script>

 

 类似资料: