摘要: Vue指令之v-for和key属性 迭代数组 <ul> <li v-for="(item, i) in list">索引:{{i}} 姓名:{{item.name}} 年龄:{{item.age}}</li></ul> 迭代对象中的属性 ​ <!-- 循环遍历对象身上的属性 -->​ <div v- 阅读全文
posted @ 2019-07-23 16:14 eadela 阅读(6933) 评论(0) 推荐(0)
摘要: 在Vue中使用样式 使用class样式 数组 <h1 :class="['red', 'thin']">这是一个邪恶的H1</h1> 数组中使用三元表达式 <h1 :class="['red', 'thin', isactive?'active':'']">这是一个邪恶的H1</h1> 数组中嵌套对 阅读全文
posted @ 2019-07-23 14:43 eadela 阅读(2297) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-07-23 12:52 eadela 阅读(269) 评论(0) 推荐(0)
摘要: 事件修饰符: .stop 阻止冒泡 .prevent 阻止默认事件 .capture 添加事件侦听器时使用事件捕获模式 .self 只当事件在该元素本身(比如不是子元素)触发时触发回调 .once 事件只触发一次 <!DOCTYPE html><html lang="en"><head> <meta 阅读全文
posted @ 2019-07-23 11:11 eadela 阅读(731) 评论(0) 推荐(0)
摘要: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv=" 阅读全文
posted @ 2019-07-23 10:07 eadela 阅读(573) 评论(0) 推荐(0)