uxcore-user-guide
React user guide
Development
git clone https://github.com/uxcore/uxcore-user-guidecd uxcore-user-guidenpm installnpm run server
if you'd like to save your install time,you can use uxcore-tools globally.
npm install uxcore-tools -ggit clone https://github.com/uxcore/uxcore-user-guidecd uxcore-user-guidenpm installnpm run depnpm run start
Test Case
npm run test
Coverage
npm run coverage
Demo
http://uxcore.alibaba.net/components/uxcore-user-guide?type=others
Contribute
Yes please! See the CONTRIBUTING for details.
使用方法
一个产品或者页面中可能有多个引导,需要给每个引导做一个key
const blokingUserGuide = UserGuideFactory;
const UserGuide = UserGuideFactory;
config 种含有的参数包括
参数名 | 类型 | 默认值 | 备注 |
---|---|---|---|
locale | string | 'zh-cn' |
语言 |
prefixCls | string | 'kuma-user-guide' |
class 前缀 |
icon | string / React 组件 | undefined | 传递 string 时,以 uxcore-icon 的名字进行渲染;如果为 falsy 的值,则不会渲染;其他直接渲染,不包含外边框。 |
className | string | '' |
定制类名 |
isBlocking | boolean | true |
是否阻塞UI |
assistType | string | undefined |
辅助按钮 / 链接,可选值包括 'SKIP' : 跳过; 'LEARN_MORE' : 了解更多; 'NO_REMIND' : 不再提醒 |
onAssistClick | function | undefined |
了解更多 / 不再提醒 点击时的回调函数 |
onComplete | function | undefined |
结束时的回调 |
然后给这个引导添加步骤,每个步骤可以有4种选择
- 使用React HOC
const Step1 = UserGuide;
- 使用DOM
const Step1 = UserGuide;
- 使用一个函数返回DOM
const Step1 = UserGuide;
- 使用图片
UserGuide;
需要开始引导时,需要
UserGuidestart;
start 可以传递参数:
参数名 | 类型 | 默认值 | 备注 |
---|---|---|---|
designMode | bool | false | 是否设计模式,如果是true ,会展示所有的步骤,以供调试及预览使用。 |
需要关闭时,可以调用
UserGuide;
stop 可以传递参数
参数名 | 类型 | 默认值 | 备注 |
---|---|---|---|
callOnComplete | bool | true | 关闭时是否调用onComplete |