<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<div id="app">
count: {
{
count}}
</div>
<script src="https://unpkg.com/vue@next"></script>
<script>
const {
ref, watchEffect } = Vue;
const state = ref(0)
watchEffect(() => {
document.body.innerHTML = `count is ${
state.value}`
})
//const vm = app.mount('#app')
//console.log(vm.title)
</script>
</html>
为什么这个button不出来
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<div id="app">
<p>count: {
{
count}}</p>
<button @click="state.count++"></button>
</div>
<script src="https://unpkg.com/vue@next"></script>
<script>
const {
ref, watchEffect } = Vue;
const state = ref(0)
watchEffect(() => {
document.body.innerHTML = `count is ${
state.value}`
}