摘要: 父组件像子组件传值 通过v-bind传递给子组件,子组件通过props对象接受绑定变量 子组件像父组件传值 通过this.$emit("delete",this.index),用方法携带参数向外传递,外部通过事件监听来出发新的事件进行获取。 <!DOCTYPE html> <html> <head> 阅读全文
posted @ 2019-12-17 22:54 嘘,在学习呢 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1.v-for for循环:v-for="item in list"中的item 为list中的每一项,类似for in 循环 <body> <div id="app"> <input type="text"/> <button>提交</button> <ul> <li v-for="item in 阅读全文
posted @ 2019-12-17 13:59 嘘,在学习呢 阅读(176) 评论(0) 推荐(0) 编辑
摘要: this 的多种指向: 1、在对象方法中, this 指向调用它所在方法的对象。 2、单独使用 this,它指向全局(Global)对象。 3、函数使用中,this 指向函数的所属者。 4、严格模式下函数是没有绑定到 this 上,这时候 this 是 undefined。 5、在 HTML 事件句 阅读全文
posted @ 2019-12-17 10:56 嘘,在学习呢 阅读(85) 评论(0) 推荐(0) 编辑