-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.html
More file actions
53 lines (40 loc) · 952 Bytes
/
1.html
File metadata and controls
53 lines (40 loc) · 952 Bytes
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
46
47
48
49
50
51
52
<html>
<body>
<script src= "https://cdnjs.cloudflare.com/ajax/libs/mobx/3.1.0/mobx.umd.js"></script>
<script src= "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
<script>
mobx.spy((event) => {
console.log(event)
})
var button = mobx.observable({
ba:[3,5],
ac:{
a:'',
b:'',
c:''
},
setaction : mobx.computed(function (){
return this.ac.a + this.ac.b
}),
setaction2 : mobx.action(function (newAction){
this.ba.push(newAction);
})
});
/*
mobx.autorun(function(){
button.ac.a;
var a = button.ba[button.ba.length-1];
if(a.a=='abc'){
console.log('run');
}
console.log(a);
})
$(function(){
$('a').click(function(){
button.ac='o' //button.setaction({a:$(this).data('a'),b:'xxx',d:'kkk'})
})
})
*/
</script>
</body></html>