记录
- 在使用
node.appendChild(childNode)时,如果childNode是另一个元素的子元素,那么在 append 后,该元素会从其父元素中删除。也就是说在父元素中forEach循环时不应该appendChild。 - 在微信小程序中使用 webview 页面跳转链接,链接地址不能使用
http且不能带有#否则页面会跳转两次 Object.assign(a,b)会将b对象的属性覆盖至a属性,但是仅会覆盖第一层。
js
let objA = {
attrs: {
class: "classname",
style: "color: red;"
}
};
let objB = {
attrs: {
class: "this is classname"
}
};
let assignObj = Object.assign(objA, objB);
//assignObj = {
// attrs: {
// class: 'this is classname'
// }
//}- ios 中日期转换不能识别 '-' 连接的日期
js
const date = "2020-05-21 18:40:03";
// 通常写法
const currentTime = new Date(date).getTime();
// 兼容 ios 写法
const currentTime = new Date(date.replace(/-/g, "")).getTime();