首页
产品
帮助文档
博客
控制台

快速入门

必要条件

添加依赖

<script src="http://static.mudu.tv/static/paint/latest/paint.js"></script>

极简使用

目录

示例代码

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>board-demo</title>
    <style>
        .container {
            display: flex;
            flex-direction: column;
        }

        #drawer-wrap, #board-wrap {
            width: 600px;
            height: 300px;
            border: 1px dashed;
            position: relative;
            margin-top: 50px;
        }

        #menu{
            top: -32px;
            position: absolute;
        }
    </style>
</head>

<script src="http://static.mudu.tv/static/paint/latest/paint.js"></script>
<body>

<div class="container">
    <div id="drawer-wrap">
        <div id="menu"></div>
        <div id="drawer"></div>
    </div>

    <div id="board-wrap">
        <div id="board"></div>
    </div>

</div>

</body>
<script>
    var rwToken = [读写token]
    var boardId = [白板ID]
    var rToken = [只读token]
    
    // 读写端初始化
    var drawer = window['paint'].createDrawer(
        document.getElementById("drawer"), 
        document.getElementById("menu"), 
        rwToken,
        boardId,
        1
    )

    // 只读端初始化
    var board = window['paint'].createBoard(
        document.getElementById("board"), 
        rToken,
        boardId,
        1
    )

    // 制度段模式一.开启监听模式。 其他只读模式
    board.listen()

</script>
</html>
    

读写端操作

   var drawer = window['paint'].createDrawer(drawerDom, menuDom, rwToken, boardId, initialPage)

只读端的三种模式

同一时间只能使用一种模式,若需要使用其他模式,请重新初始化

var board = window['paint'].createBoard(drawerDom , rToken, boardId, initialPage)