-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
83 lines (82 loc) · 2.99 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<style>
.testClass {
color: red;
}
</style>
</head>
<body>
<!-- <div v-show="open" v-red>=这是模板测试和v-show测试 {{ msg }} + 4 6</div>
<div v-show="!open" v-red>这是模板测试和初始值为false的v-show测试 {{ msg }}</div>
<div v-if="open">这是v-if测试</div> -->
<!-- <div v-data="controller">
<div v-if="open">这是初始值为false的v-if测试</div>
<button @click="open = !open">
基础事件测试
</button>
</div> -->
<div id="app">
<div v-data="controller">
<input type="text" v-model="msg">
<div>{{ msg }}</div>
<div id="test" v-if="!open" :class="['testClass', classes]">这是v-if测试</div>
<!-- <div id="test" v-if="open" :class="['testClass', classes]">这是v-if测试</div>
<div id="test" v-if="open" :class="{ testClass: showClass }">这是v-if和:class的测试</div>
<div :style="{ color }">
<div v-if="open">
xyz
</div>
</div> -->
<div style="display:flex;flex-direction: column;">
<div v-for="i in list" :key="i.key">
<!-- {{ i.text }} -->
<input type="text" v-model="i.text">
{{msg}}
<!-- <div v-for="j in lists" :key="j" style="color:aqua">
{{ j }}
<div v-for="x in listss" :key="x" style="color: pink">
{{ i.text }}
<span @click="lists.push(Math.random())">
4888
</span>
</div>
</div> -->
</div>
</div>
<button @click="list.push({ text: Math.random() })">
toggle me
</button>
<button @click="msg = 'test'">
toggle me
</button>
<button @click="open = !open">
toggle me
</button>
</div>
</div>
<script type="module">
import { createApp } from './src/app.ts'
let app = createApp()
app.data("controller", () => {
return {
open: true,
showClass: false,
msg: 'hello template',
classes: 'xyz',
color: 'pink',
list: [{ text: 1, key: 2 }, { text: 2, key: 3 }, { text: 7, key: 4 }, { text: 5, key: 5}, { text: 3, key: 6}], //
lists: ['1'],
listss: ['tyutyu'],
}
})
app.mount('#app')
window.app = app
</script>
</body>
</html>