1、有三个按钮,并排
2、点home按钮,出现, Home component字样
3、点Posts按钮,出现,
Cat Ipsum
Hipster Ipsum
Cupcake Ipsum
Click on a blog title to the left to view it.
Cat Ipsum
Hipster Ipsum
Cupcake Ipsum
是li排列的,但没有编序号
4、点Cat Ipsum,出现,一段话,点三个词,分别出来三段话
三层,两个动作。
5、点Archive 按钮,出现Archive component。
6、第一个和第三个按钮还可以像第二个那样扩展。
怎样才能实现功能呢?
从第一个开始?
实现点击home,出现home component
第一次写错了,没有实现。
<!DOCTYPE html>
<div>
<button @click="home">Home component
</button>
</div>
<script>
const app = Vue.createApp ({
data() {
return
}
})
</script>
还不对吗,那应该是怎样?
<!DOCTYPE html>
<div id ="messageHome">
<button @click="message">Home</button>
</div>
</html>
<script src="https://unpkg.com/vue@next"></script>
<script>
const app = Vue.createApp ({
data() {
return {
message: 'Home component'
}
}
})
app.mount('#messageHome')
</script>
为啥不对呢?