-
Notifications
You must be signed in to change notification settings - Fork 5
/
templateError.html
117 lines (103 loc) · 2.35 KB
/
templateError.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<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>log error template</title>
<script>
location.hash = '#f12'
</script>
<!-- <script src="https://wusfen.github.io/console.js/dist/console.js"></script> -->
<script src="../vm.js"></script>
<style>
* {
box-sizing: border-box;
}
input[type="checkbox"] {
vertical-align: -.25ex;
}
#app {
max-width: 375px;
padding: 2em 1em;
margin: 2em auto;
box-shadow: 0px 1px 10px #bbb;
}
.input {
display: block;
width: 100%;
border: solid 1px #bbb;
border-radius: 3px;
padding: .75em;
}
.list {
color: #4ca6d4;
line-height: 1.5;
user-select: none;
}
.list li {
margin-bottom: .5em;
}
.done {
color: #ffa5a5;
text-decoration: line-through;
}
.del {
width: 1.5em;
height: 1.5em;
text-align: center;
border: solid 1px #bbb;
border-radius: 50%;
background: #fff;
margin-left: 1em;
}
#output{
background: #fee;
color: #f00;
}
</style>
</head>
<body>
<div id="app">
<input class="input" v-model="input" @keydown.enter="add" placeholder="enter add">
<ul class="list">
<li v-for="item,index) in list" :class="{done:item.done}">
<label>
<input type="checkbox" v-model="item.done">
<span>{{item.content}}</span>
</label>
<button class="del" v-if="item.done" @click="remove(index)" type="button">-</button>
</li>
<li v-if="!list.length">empty!</li>
</ul>
</div>
<pre id="output">
<script>
window.onerror = function (e) {
output.innerHTML += '\n' + e.toString().replace(/</g, '<')
}
</script>
</pre>
<script>
var vm = new Vue({
el: '#app',
data: {
input: '',
list: [
{ content: 'todo1', done: true },
{ content: 'todo2', done: false }
]
},
methods: {
add: function () {
vm.input && vm.list.push({ content: vm.input })
vm.input = ''
},
remove: function (index) {
vm.list.splice(index, 1)
}
}
})
</script>
</body>
</html>