-
Notifications
You must be signed in to change notification settings - Fork 0
/
react-joyride.js
45 lines (42 loc) · 967 Bytes
/
react-joyride.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React from 'react'
import Joyride from 'react-joyride'
function ReactJoyride() {
const steps = [
{
title: '我是標題',
target: '.my-other-step',
content: '我是內容',
hideCloseButton: false,
disableBeacon: false,
locale: {
back: '上一步',
next: '下一步',
skip: '跳過',
close: '關閉',
},
},
{
title: '我是標題1',
target: '.my-first-step',
content: '我是內容1',
hideCloseButton: false,
disableBeacon: false,
locale: {
next: '下一步',
skip: '跳過',
close: '關閉',
},
},
]
return (
<>
<Joyride
steps={steps}
run // 如果false就不再有效果,預設為true
/>
<button type="button" className="my-first-step">1</button>
<button type="button" className="my-other-step">2</button>
</>
)
}
export default ReactJoyride