- Implement dynamic styles and event handling in Vue2 with a card component. - Create lifecycle methods exercise to simulate async data loading and instance destruction. - Develop a component communication exercise with props, events, and slots. - Build a comprehensive course management dashboard with filtering, statistics, and component interactions.
29 lines
830 B
Markdown
29 lines
830 B
Markdown
# 练习 1:Vue 实例和数据
|
||
|
||
## 目标
|
||
|
||
学会写一个最基础的 Vue2 实例,并让页面内容跟着数据变化。
|
||
|
||
## 你要练什么
|
||
|
||
- `new Vue()`
|
||
- `el`
|
||
- `data`
|
||
- `methods`
|
||
- 模板插值 `{{ }}`
|
||
|
||
## 任务
|
||
|
||
请基于页面结构完成以下操作:
|
||
|
||
- 显示课程标题和章节数量
|
||
- 点击按钮后让学习人数加 1
|
||
- 在控制台输出当前学习人数
|
||
|
||
## 文件
|
||
|
||
- [starter.html](/Users/lijiaqing/home/wwwroot/front-end-example/07-vue2/01-vue-instance-and-data/starter.html)
|
||
- [starter.js](/Users/lijiaqing/home/wwwroot/front-end-example/07-vue2/01-vue-instance-and-data/starter.js)
|
||
- [answer.html](/Users/lijiaqing/home/wwwroot/front-end-example/07-vue2/01-vue-instance-and-data/answer.html)
|
||
- [answer.js](/Users/lijiaqing/home/wwwroot/front-end-example/07-vue2/01-vue-instance-and-data/answer.js)
|