-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.html
More file actions
48 lines (42 loc) · 1.13 KB
/
proxy.html
File metadata and controls
48 lines (42 loc) · 1.13 KB
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
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="./proxy.js"></script>
<script>
const school = [
{ id: 1, name: '北京大学' },
{ id: 2, name: '河北大学' },
{
test1: {
name: 'test1',
test2: {
name: 'test2',
test3: {
name: 'test3'
}
}
}
}
]
const data = DataProxy({ name: 'tom', age: 13, text: { school: school } }, (val) => {
console.log(val)
});
data.numes = 'ss';
// watch(data.text.school[2].test1.test2, 'name', (val) => {
// console.log('新值',val.value)
// })
// watch(data.text.school, (val) => {
// console.log(22222, val.data[0])
// })
watch(data.text.school[0], 'name', (value) => {
console.log('监听school[0].name',value)
})
</script>
</body>
</html>