babel-plugin-starboard-buried-point
v0.0.5
Published
## 安装
Downloads
3
Readme
使用文档
安装
yarn add babel-plugin-starboard-buried-point --dev
npm install babel-plugin-starboard-buried-point --save-dev
引入插件
.babelrc
{
"plugins": [["babel-plugin-starboard-buried-point", {
// 允许埋点的事件句柄
rules: [
'onClick',
'onChange'
]
}]]
}
使用
JSX
const Render = () => {
/*
* Get buried point parameters, if any
*/
const getBuriedParams = () => {
return {
age: 22
}
}
return <div data-open={'page_view'} data-handle={'onClick'}>埋点节点</div>
}
API
|参数|说明|类型|必选| |:---|:--------------------|:---|---| |data-open|自定义埋点事件,如:page_view,click|string|是| |data-handle|埋点句柄,如:onClick, onChange|string|是|