-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdemo9.html
37 lines (35 loc) · 1.02 KB
/
demo9.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>flowJS demo9</title>
</head>
<body>
</body>
<script type="text/javascript" src="./flowJS.js"></script>
<script type="text/javascript">
flowJS({
init:function(){
this.setNext('步骤A');
this.next();
},
'步骤A':function(){
console.log('执行 步骤A');
this.setNext('步骤B');
this.next();
},
'步骤B':function(){
console.log('执行 步骤B');
this.setNext('步骤C');
console.log('当前流程运行的轨迹:');
console.log(flowJS.trace); //打印结果:["init", "步骤A", "步骤B"]
this.next();
},
'步骤C':function(){
console.log('执行 步骤C');
}
});
console.log('当前流程运行的轨迹:');
console.log(flowJS.trace); //打印结果:["init", "步骤A", "步骤B", "步骤C"]
</script>
</html>