该文被密码保护。 阅读全文
摘要:
1,绑定一个class名 <p [class.isActive]="boolean"> p element works! </p> 也可 <p [class.isActive]="fn()"> p element works! </p> fn(){ return boolean } 2,绑定多个cl 阅读全文
摘要:
<!-- input表单type属性值: --> <!-- type = "email" 限制用户输入必须为Email类型 --> email<input type="email"> <!-- type="url" 限制用户输入必须为URL类型 --> url<input type="url"> < 阅读全文
摘要:
<script> //(1)函数声明 // 不能直接在后面加()执行,可以在前面加 +,-,! 等让他立即执行,执行完函数a销毁 // 报错 // function a(){ // console.log('111') // }() //不报错,执行 +function a(){ console.l 阅读全文
摘要:
1,安装Swiper 阅读全文
摘要:
<div id="box" class="box" title="abc" style="width:100px;height:100px;">123</div> <script> var oBox=document.getElementById('box'); //Attribute consol 阅读全文
摘要:
//去掉左右空格兼容 var str=' ab c '; var re=/^\s+ | \s+$/g; if(String.prototype.trim){ console.log(str.trim()+'111') }else{ console.log(str.replace(re,'')+'22 阅读全文
摘要:
匿名函数(自执行函数) 写法: ①( function( ){ } )( ) ②(function( ) { } ( )) 传参 : ( function( a,b){ console.log(a+b) } ) ( 10,20 ) 闭包:函数嵌套函数,里面的函数引用外面函数的变量,这些变量不会被释放 阅读全文
摘要:
console.log(4&&5) //5 console.log(0&&0) //0 console.log(0&&5) //0 console.log(5&&0) //0 // &&中如果两边都没有0,则取后面的那个。 // 如果有0,或者两个0,则取0 console.log(4||5) // 阅读全文