-
Notifications
You must be signed in to change notification settings - Fork 1
/
diff2html.html
62 lines (60 loc) · 2.63 KB
/
diff2html.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
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
<!doctype html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title>Document</title>
<link crossorigin="anonymous" integrity="sha384-4PP1cSKpUJ5E/N1irryy57QVhBhzc7E6Mv+7XiIjZkK/Xr5isrk5qWyqVp8l0eVi" href="https://lib.baomitu.com/diff2html/2.9.0/diff2html.min.css" rel="stylesheet">
<script crossorigin="anonymous" integrity="sha384-7ClrVl6imgiMLKNwP0pVjqAWDr7pV9sJsW+Hv9d8enmWvgXRtVXEqmotR7J9UQuu" src="https://lib.baomitu.com/diff2html/2.9.0/diff2html.min.js"></script>
<script src="http://cdn.bootcss.com/vue/2.2.4/vue.min.js"></script>
</head>
<body>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=22793199&height=66"></iframe>
<div id="wrap">
<div>
<div v-html="prettyHtml" />
</div>
<input type="text" v-focus="testFunc">
</div>
<script>
new Vue({
el: '#wrap',
directives: {
focus: {
// 指令的定义
inserted: function (el, binding) {
el.focus()
console.log(binding)
console.log(binding.value)
}
}
},
components: {
},
data () {
return {
diffs:`--- 2019年06月13日18:52:36\n+++ 2019年06月13日18:52:43\n@@ -1035,6 +1035,17 @@ func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (\n \n // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n \n+func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {\n+\tr0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)))\n+\tn = int(r0)\n+\tif e1 != 0 {\n+\t\terr = errnoErr(e1)\n+\t}\n+\treturn\n+}\n+\n+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n+\n-func read(fd int, p []byte) (n int, err error) {\n \tvar _p0 unsafe.Pointer\n \tif len(p) > 0 {\n`
}
},
computed: {
prettyHtml() {
return Diff2Html.getPrettyHtml(this.diffs, {
inputFormat: "diff",
showFiles: true,
matching: "words",
outputFormat: "line-by-line"
});
}
},
created () {
},
methods : {
testFunc() {
console.log('123')
}
}
});
</script>
</body>
</html>