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/02-template-bindings/answer.js
Normal file
16
07-vue2/02-template-bindings/answer.js
Normal file
@@ -0,0 +1,16 @@
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: {
|
||||
courseTitle: "Vue2 模板语法",
|
||||
teacher: "李老师",
|
||||
coverUrl: "https://picsum.photos/800/320?random=21",
|
||||
courseLink: "https://cn.vuejs.org/",
|
||||
isCollected: false,
|
||||
},
|
||||
methods: {
|
||||
toggleCollect() {
|
||||
this.isCollected = !this.isCollected;
|
||||
console.log("收藏状态:", this.isCollected ? "已收藏" : "未收藏");
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user