@x-group/abtest-sdk
v1.0.7
Published
创建ab实验
Downloads
15
Keywords
Readme
@x-group/abtest-sdk
项目介绍
AB 实验 sdk,用于创建 AB 实验
AbtestModal 参数:
visible:boolean 组件显示隐藏 request:request 项目请求方法 onClose:()=>void 关闭按钮触发函数 permission:{ sdk 内部按钮显示或隐藏的权限 quota: ('ADD'| 'EDIT'| 'DETAIL')[], mutualExclusion: ('ADD'| 'EDIT'| 'DETAIL')[], experiment: ('ADD', 'EDIT', 'DETAIL')[], }
接入方式
import request from '@/utils/request';
import React, { useState } from 'react';
import { AbTestModal } from '@x-group/abtest-sdk';
export default function App() {
const [visible, setVisible] = useState(true);
return (
<AbTestModal
permission={{
quota: ['ADD', 'EDIT', 'DETAIL'],
mutualExclusion: ['ADD', 'EDIT', 'DETAIL'],
experiment: ['ADD', 'EDIT', 'DETAIL'],
}}
visible={visible}
request={request}
onClose={() => setVisible(false)}
/>
);
}