完全跑通1.0版本
This commit is contained in:
27
frontend/node_modules/element-plus/lib/components/watermark/src/utils.js
generated
vendored
Normal file
27
frontend/node_modules/element-plus/lib/components/watermark/src/utils.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
//#region ../../packages/components/watermark/src/utils.ts
|
||||
/** converting camel-cased strings to be lowercase and link it with Separator */
|
||||
function toLowercaseSeparator(key) {
|
||||
return key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
||||
}
|
||||
function getStyleStr(style) {
|
||||
return Object.keys(style).map((key) => `${toLowercaseSeparator(key)}: ${style[key]};`).join(" ");
|
||||
}
|
||||
/** Returns the ratio of the device's physical pixel resolution to the css pixel resolution */
|
||||
function getPixelRatio() {
|
||||
return window.devicePixelRatio || 1;
|
||||
}
|
||||
/** Whether to re-render the watermark */
|
||||
const reRendering = (mutation, watermarkElement) => {
|
||||
let flag = false;
|
||||
if (mutation.removedNodes.length && watermarkElement) flag = Array.from(mutation.removedNodes).includes(watermarkElement);
|
||||
if (mutation.type === "attributes" && mutation.target === watermarkElement) flag = true;
|
||||
return flag;
|
||||
};
|
||||
//#endregion
|
||||
exports.getPixelRatio = getPixelRatio;
|
||||
exports.getStyleStr = getStyleStr;
|
||||
exports.reRendering = reRendering;
|
||||
exports.toLowercaseSeparator = toLowercaseSeparator;
|
||||
|
||||
//# sourceMappingURL=utils.js.map
|
||||
Reference in New Issue
Block a user