feat: add Vue2 exercises for dynamic styles, lifecycle methods, component communication, and course management dashboard
- 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.
This commit is contained in:
16
07-vue2/06-class-style-and-event/starter.js
Normal file
16
07-vue2/06-class-style-and-event/starter.js
Normal file
@@ -0,0 +1,16 @@
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: {
|
||||
title: "动态样式练习",
|
||||
isActive: false,
|
||||
progress: 35,
|
||||
},
|
||||
methods: {
|
||||
toggleCard() {
|
||||
// 任务:
|
||||
// 1. 切换 isActive
|
||||
// 2. 如果激活了,让 progress 增加到 80
|
||||
// 3. 如果取消激活,让 progress 回到 35
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user