备忘一下, 采集详情页重构需要的内容如下:
closest
目录Index
- closest - element-closest-polyfill
- fetch
closest - element-closest-polyfill
参考 idmadj/element-closest-polyfill
if (!Element.prototype.matches) {
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}
if (!Element.prototype.closest) {
Element.prototype.closest = function (s) {
var el = this;
do {
if (el.matches(s)) return el;
el = el.parentElement || el.parentNode;
} while (el !== null && el.nodeType === 1);
return null;
};
}