08 2018 档案
摘要:<!DOCTYPE html Document A组件 destroy msg:{{msg}} //生命周期:初始化阶段 运行中阶段 销毁阶段 Vue.component("aaa",{ template:" aaa", data:function(){ return {msg:'hello'} }
阅读全文
摘要:一、通过路由带参数进行传值 1、两个组件 A和B,A组件通过query把orderId传递给B组件(触发事件可以是点击事件、钩子函数等) this.$router.push({ path: '/conponentsB', query: { orderId: 123 } }) // 跳转到B 2、在B
阅读全文
摘要:1、元素获取 / 原生js / var ele = document.getElementById('idName'); var eleArr = document.getElementsByClassName('className'); var eleArr = document.getEleme
阅读全文
摘要:
阅读全文
摘要:一、基本概念 1、事件:用户/浏览器自身执行的某种动作(点击click、加载load,页面滚动scroll的等); 2、事件处理程序:响应某个事件的处理函数,又叫事件侦听器 二、事件流 事件流 1、事件冒泡 由IE提出 由下向上 2、事件捕获 由Netscape团队提出 由上向下 由于老版本浏览器不
阅读全文
摘要:函数this的指向不是由函数定义时确定,而是在调用时才确定 function test() { console.log(this); } test(); //window '严格模式下为undefined' var obj = { id: 1, test: function () { console
阅读全文

浙公网安备 33010602011771号