微信小程序
1、微信小程序多次保存海報文字顏色大小排版錯誤,偶爾復現
https://developers.weixin.qq.com/community/develop/doc/000ee497d8cd78e50257df8d156400
H5移動端
1、上傳文件報錯Illegal Invocation
由於ajax對參數默認序列化處理,所以要設置processData:false禁止參數處理
2、ios無法識別new Date(2019-06-21 18:26) 返回數據爲null
需要把‘-’替換成‘/’
str.replace(\-\g,'/') //new Date(2019/06/21 18:26)
3、watch無法監聽根據索引改變的數組
vm.items[indexOfItem] = newValue
Vue.set(vm.items, indexOfItem, newValue) //第一種方法
vm.$set(vm.items, indexOfItem, newValue) //第二種方法
4、ios頻繁點擊滾動
<script>
var agent = navigator.userAgent.toLowerCase(); //檢測是否是ios
var iLastTouch = null; //緩存上一次tap的時間
if (agent.indexOf('iphone') >= 0 || agent.indexOf('ipad') >= 0) {
document.body.addEventListener('touchend', function (event) {
var iNow = new Date()
.getTime();
iLastTouch = iLastTouch || iNow + 1 /** 第一次時將iLastTouch設爲當前時間+1 */ ;
var delta = iNow - iLastTouch;
if (delta < 500 && delta > 0) {
event.preventDefault();
return false;
}
iLastTouch = iNow;
}, false);
}
</script>
web端
1、layui框架 layer.open裏點擊事件失效
$(’#id’).on(‘click’, function () {})
改爲
$(document).on(‘click’, ‘#id’, function () {})
2、layui框架 layer.open裏laydate閃退無法彈出
- layer.open要寫type: 1
- content: $(’#id’)後面不要加.html()
- content隱藏不要用class=“layui-hide” 要設置css display:none
css
1、css禁止瀏覽器預覽圖片
pointer-events:none
2、text-align:justify ios不兼容
利用::after僞類,給元素最後設置一個內聯元素,並設置寬度爲100%
text::after{content:'';width:100%;display:inline-block;}