-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
30 lines (29 loc) · 948 Bytes
/
example.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
<html>
<body>
<div id="app">
输入框:
<input class="name" :value="input" @input="update"></input>
<div>我的输入:{{input}}</div>
<button @click="clickHandler">点击</button>
你点了:{{data.count}} 下
</div>
</body>
<script src="./dist/bundle.js"></script>
<script>
const { reactive, ref, effect, compile, createElement, createText, miniVue1, createApp } = miniVue;
createApp({
setup() {
let input = ref(123);
let data = reactive({
count: 0
});
return {
input,
data,
update: (val) => void (input.value = val.target.value),
clickHandler: () => void (data.count += 1)
}
}
}).mount('#app');
</script>
</html>