1. updateListener

作用:截取用户在UI上触发的update事件。

1.1. 参数说明:

形式参数:有

名称 说明 类型 是否必填 示例
key 快照key 字符串 string "1232456"
parameter 快照信息 对象 Object 见下方
callback 回调函数 方法 function 见下方
返回值说明 类型 示例
无返回值 NULL NULL

1.1.1. 回调函数的参数:

名称 说明 类型 是否必须 示例
state 状态,为true时才会进行后续操作 布尔值boolean true
name 快照name 字符串string ”快照1“
key 快照key 字符串string 否,如果传递了该参数,那么 将用这个参数来更新快照 "123456"
parameter 快照信息 对象Object 否,如果传递了该参数,那么 将用这个参数来更新快照 见下方
var parameter = { 
    cameraState: cameraState,
    componentState: componentState,    //{Array} 对象数组 , 构件信息,
    highlightComponentsKeys: highlightComponentsKeys,    //{Array}数组,高亮的构件 key集合
    highlightModelsKeys: highlightModelsKeys,    //{Array}数组,高亮的模型key集合 
    imageURL: imgURL,    //{base64} 当前canvas的截图
    width: w,    //{int} 图片宽度,当前canvas图片的宽度 
    height: h,   //{int} 图片高度,当前canvas图片的高度 
    num:  num,    //{int} 当前快照列表的序号
    code: new Date().getTime().toString(), 
    name: "快照" + num,     //快照名称 
    description: "无注释"    //快照描述
};

1.2. 调用方式:

snapshot.updateListener(key,parameter,  function  (state,  key2,parameter2) {});
版权所有@盈嘉互联(北京)科技有限公司 京ICP备15051988号-9 Copyright © 2021 all right reserved,powered by Gitbook该文件修订时间: 2021-12-20 09:59:48

results matching ""

    No results matching ""