@mdui/jq
Version:
拥有和 jQuery 相似 API 的轻量级 JavaScript 工具库
13 lines (12 loc) • 362 B
JavaScript
import { $ } from '../$.js';
import './clone.js';
import './get.js';
import './map.js';
import './replaceWith.js';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
$.fn.replaceAll = function (target) {
return $(target).map((index, element) => {
$(element).replaceWith(index ? this.clone() : this);
return this.get();
});
};