easinote-proxy

- 外部业务使用 - 外部业务不用关心当前的页面是在windows客户端运行还是在web内嵌的iframe运行 - 以React为例 - 两种方式 - 方式一:可以在程序的入口处初始化 ``` import EasiNoteProxy from 'easinote-proxy'; EasiNoteProxy.init().then(()=> ReactDom.render("xxx", "xx")); ```

Usage no npm install needed!

<script type="module">
  import easinoteProxy from 'https://cdn.skypack.dev/easinote-proxy';
</script>

README

  • 外部业务使用
    • 外部业务不用关心当前的页面是在windows客户端运行还是在web内嵌的iframe运行
    • 以React为例
      • 两种方式
        • 方式一:可以在程序的入口处初始化
          import EasiNoteProxy from 'easinote-proxy';
          EasiNoteProxy.init().then(()=> ReactDom.render("xxx", "xx"));
          
        • 方式二:在组件的生命周期中初始化
          componentWillMount/ComponentDidMount(){
            await EasiNoteProxy.init()
          }
          
      • 如何调用?
        EasiNoteProxy.Proxy.XXX('xxx');
        
  • 方法简介
    • 插入多媒体
      • 方法名:
        • insertMedia
      • 参数:
        • elementData: string
          • 注意:elementData反序列化是一个对象,对象包含的字段如下:
            • url: 图片的具体地址
            • fileName: 图片文件类型【需要提供文件后缀,如:小猫.png】
    • 插入web内容卡片元素
      • 方法名:
        • insertElementByJson
      • 参数:
        • elementType: string 元素类型名
        • elementData: string 元素数据
          • 注意:elementData反序列化是一个对象,对象包含的字段见该链接【https://gitee.com/easinote/client-web-api-documentation/blob/master/zh-CN/apis/direct-api/element-json/web-presentation-card.md】
    • 插入图片可折叠卡片元素
      • 方法名:
        • insertElementByJson
      • 参数:
        • elementType: string 元素类型名
        • elementData: string 元素数据
          • 注意:elementData反序列化是一个对象,对象包含的字段见该链接【https://gitee.com/easinote/client-web-api-documentation/blob/master/zh-CN/apis/direct-api/element-json/image-fold-card.md】