- 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.
15 lines
244 B
JavaScript
15 lines
244 B
JavaScript
new Vue({
|
|
el: "#app",
|
|
data: {
|
|
title: "动态样式练习",
|
|
isActive: false,
|
|
progress: 35,
|
|
},
|
|
methods: {
|
|
toggleCard() {
|
|
this.isActive = !this.isActive;
|
|
this.progress = this.isActive ? 80 : 35;
|
|
},
|
|
},
|
|
});
|