摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document< 阅读全文
posted @ 2020-09-07 20:44 wing1377 阅读(661) 评论(0) 推荐(0) 编辑
摘要: 子组件模板: <input type="text" class="num" :value='item.num' v-on:blur='changeNum(item.id, $event)'/> 子组件方法: changeNum: function(id, event){console.log(id, 阅读全文
posted @ 2020-09-07 18:38 wing1377 阅读(3927) 评论(0) 推荐(0) 编辑
摘要: 数组方法:map 核心 创建一个新数组,其结果是该数组中的每个元素都调用一个提供的函数后返回的结果。 不改变原数组 返回值是一个新的数组 缺陷 可以使用return,但是不能使用break和continue 回调函数参数 第一个参数:item 数组中的子元素 第二个元素:index 数组元素的索引值 阅读全文
posted @ 2020-09-07 12:49 wing1377 阅读(653) 评论(0) 推荐(0) 编辑
摘要: 组件注册 组件 组件 (Component) 是 Vue.js 最强大的功能之一 组件可以扩展 HTML 元素,封装可重用的代码 全局组件 全局组件注册语法 Vue.component('组件名称', ) 第1个参数是标签名称,第2个参数是一个选项对象 全局组件 注册后,任何vue实例都可以用 // 阅读全文
posted @ 2020-09-07 07:44 wing1377 阅读(161) 评论(0) 推荐(0) 编辑