no need jQuery anymore & You don't need jQuery anymore!
no need jQuery anymore & You don't need jQuery anymore!
"use strict";
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms 20180101 - forever
*
* @description no-need-jquery & You don't need jQuery anymore!
* @augments
* @example
*
*/
var $ = $ || {};
// const $ = {};
$.DOM_queryAll = ((str = `[data-sortable-box*="sortable-box"]`, debug = false) => {
let results = document.querySelectorAll(str);
// let results = [...document.querySelectorAll(str)];
if (debug) {
if (results) {
console.log(`result = `, results);
}else{
console.log(`Error: result = `, results);
}
}
return results ? results : ``;
});
$.DOM_query = ((str = `[data-sortable-box*="sortable-box"]`, debug = false) => {
let result = document.querySelector(str);
// let result = [...document.querySelector(str)];
if (debug) {
if (result) {
console.log(`result = `, result);
}else{
console.log(`Error: result = `, result);
}
}
return result ? result : ``;
});
export default $;
const DOM_queryAll = $.DOM_queryAll;
const DOM_query = $.DOM_query;
export {
DOM_query,
DOM_queryAll,
DOM_query as $qs,
DOM_queryAll as $qsa
};
/*
// import $ from "jquery";
import {$qsa, $qs} from "../utils/no-need-jquery";
import { $qsa, $qs } from "../utils/no-need-jquery";
import {
$qsa,
$qs
} from "../utils/no-need-jquery";
import {
DOM_query,
DOM_queryAll,
} from "../utils/no-need-jquery";
import {
DOM_query,
DOM_queryAll,
$qs,
$qsa
} from "../utils/no-need-jquery";
*/
refs
no need jQuery anymore
http://www.ruanyifeng.com/blog/2013/05/jquery-free.html
https://mathiasbynens.be/demo/jquery-size
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/9210664.html
未经授权禁止转载,违者必究!