摘要:
vue不同的类型绑定不同的类名 第一种 <div v-for="(item, index) in list" :key="index" > <div class="item-tag" :class="addclassName(item)"> {{ item.cont}} </div> </div> 阅读全文
posted @ 2021-03-28 20:39
南风晚来晚相识
阅读(278)
评论(0)
推荐(0)
摘要:
let wekks=this.getweekday('2021-03-28'); console.log(wekks);//输出‘日’ function getweekday(date){ var weekArray = new Array("日", "一", "二", "三", "四", "五", 阅读全文
posted @ 2021-03-28 20:24
南风晚来晚相识
阅读(148)
评论(0)
推荐(0)
摘要:
1. 阻止事件冒泡 兼容w3c浏览器 function cBubble(e){ if(e.stopPropagation){ e.stopPropagation();//ie9+ }else{//ie678 e.cancelBubble = true; } } 2.阻止浏览器默认行为 functio 阅读全文
posted @ 2021-03-28 10:40
南风晚来晚相识
阅读(382)
评论(0)
推荐(0)
摘要:
1. onclick事件 es5 普通事件就是直接触发事件,相同的事件会被覆盖掉。代码如下: let demoDiv=document.querySelector(".demo") demoDiv.onclick = function(){ console.log('你好1') } demoDiv. 阅读全文
posted @ 2021-03-28 09:20
南风晚来晚相识
阅读(1376)
评论(0)
推荐(0)