-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest4.html
36 lines (35 loc) · 839 Bytes
/
test4.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>test4</title>
</head>
<body>
<script src="./js/observer.js"></script>
<script src="./js/watcher.js"></script>
<script src="./js/compile.js"></script>
<script>
/* eslint-disable no-new */
/* eslint-disable no-undef */
function mvue(options) {
this.$options = options
this.$data = options.data
this.$el = document.querySelector(options.el)
this.init()
}
mvue.prototype.init = function() {
observer(this.$data)
new Compile(this)
}
</script>
<div id="app">{{ word }}</div>
<script>
const vm = new mvue({
el: '#app',
data: {
word: 'hello world, hello everyone!'
}
})
</script>
</body>
</html>