-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.html
More file actions
64 lines (57 loc) · 1.53 KB
/
proxy.html
File metadata and controls
64 lines (57 loc) · 1.53 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
<script>
// const dom = new Proxy({}, {
// get(target, property) {
// debugger
// console.log('property',property)
// return function(attrs = {}, ...children) {// 只是对有属性的操作
// debugger
// const el = document.createElement(property);
// for (let prop of Object.keys(attrs)) {
// el.setAttribute(prop, attrs[prop]);
// }
// for (let child of children) {
// if (typeof child === 'string') {
// child = document.createTextNode(child);
// }
// el.appendChild(child);
// }
// return el;
// }
// }
// });
// const el = dom.div({},
// 'Hello, my name is ',
// dom.a({href: '//example.com'}, 'Mark'),
// '. I like:',
// dom.ul({},
// dom.li({}, 'The web'),
// dom.li({}, 'Food'),
// dom.li({}, '…actually that\'s it')
// )
// );
// document.body.appendChild(el);
// const fn = function () {
// console.log(fn.length);
// }
// fn(1, 2, 3, 4, 5, 6)
// function isReserved(str) {
// var c = (str + '').charCodeAt(0);
// return c === 0x24 || c === 0x5F
// }
const vue = {};
Object.defineProperty(vue, '$data', {
get() {
return 10;
}
})
console.log(vue.$data);
</script>