Commit 6e63601e authored by 张九刚's avatar 张九刚

feat: 在 md.js 中新增 sensorLogTake 函数以主动触发埋点,并更新事件对象的注释说明

parent 839fcd3d
......@@ -36,7 +36,7 @@ const login = (ext) => {
/**
* 传感器埋点
* @param {*} evt 事件对象
* @param {*} evt 事件对象,通过节点data-log属性配置
*
* xcxClick 有值就是点击事件
* xcxPage 有值就是页面浏览事件
......@@ -74,10 +74,27 @@ const sensorLog = (evt) => {
}
}
/**
* 主动通过配置数据触发埋点
* @param {*} evt
*/
const sensorLogTake = (logObj) => {
if(!logObj){
return;
}
const evt = {
currentTarget: {
dataset: {
log: logObj
}
}
}
sensorLog(evt);
}
export default {
init,
sensors,
login,
sensorLog
sensorLog,
sensorLogTake
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment